modelgbp Generated OpFlex Model  1.3.0
EpGroupToNetworkRSrc.hpp
1 
10 #pragma once
11 #ifndef GI_GBP_EPGROUPTONETWORKRSRC_HPP
12 #define GI_GBP_EPGROUPTONETWORKRSRC_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 
18 namespace modelgbp {
19 namespace gbp {
20 
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 112;
30 
35  bool isRoleSet()
36  {
37  return getObjectInstance().isSet(3670018ul, opflex::modb::PropertyInfo::ENUM8);
38  }
39 
44  boost::optional<const uint8_t> getRole()
45  {
46  if (isRoleSet())
47  return (const uint8_t)getObjectInstance().getUInt64(3670018ul);
48  return boost::none;
49  }
50 
56  const uint8_t getRole(const uint8_t defaultValue)
57  {
58  return getRole().get_value_or(defaultValue);
59  }
60 
70  {
71  getTLMutator().modify(getClassId(), getURI())->setUInt64(3670018ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(3670018ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
91  bool isTargetSet()
92  {
93  return getObjectInstance().isSet(3670019ul, opflex::modb::PropertyInfo::REFERENCE);
94  }
95 
100  boost::optional<opflex::modb::class_id_t> getTargetClass()
101  {
102  if (isTargetSet())
103  return getObjectInstance().getReference(3670019ul).first;
104  return boost::none;
105  }
106 
111  boost::optional<opflex::modb::URI> getTargetURI()
112  {
113  if (isTargetSet())
114  return getObjectInstance().getReference(3670019ul).second;
115  return boost::none;
116  }
117 
123  opflex::modb::class_id_t getTargetClass(opflex::modb::class_id_t defaultValue)
124  {
125  return getTargetClass().get_value_or(defaultValue);
126  }
127 
133  opflex::modb::URI getTargetURI(opflex::modb::URI defaultValue)
134  {
135  return getTargetURI().get_value_or(defaultValue);
136  }
137 
148  {
149  getTLMutator().modify(getClassId(), getURI())->setReference(3670019ul, 137, uri);
150  return *this;
151  }
152 
171  const std::string& policySpaceName,
172  const std::string& gbpBridgeDomainName)
173  {
174  getTLMutator().modify(getClassId(), getURI())->setReference(3670019ul, 137, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpBridgeDomain").addElement(gbpBridgeDomainName).build());
175  return *this;
176  }
177 
188  {
189  getTLMutator().modify(getClassId(), getURI())->setReference(3670019ul, 141, uri);
190  return *this;
191  }
192 
211  const std::string& policySpaceName,
212  const std::string& gbpFloodDomainName)
213  {
214  getTLMutator().modify(getClassId(), getURI())->setReference(3670019ul, 141, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpFloodDomain").addElement(gbpFloodDomainName).build());
215  return *this;
216  }
217 
228  {
229  getTLMutator().modify(getClassId(), getURI())->setReference(3670019ul, 146, uri);
230  return *this;
231  }
232 
251  const std::string& policySpaceName,
252  const std::string& gbpRoutingDomainName)
253  {
254  getTLMutator().modify(getClassId(), getURI())->setReference(3670019ul, 146, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).build());
255  return *this;
256  }
257 
265  {
266  getTLMutator().modify(getClassId(), getURI())->unset(3670019ul, opflex::modb::PropertyInfo::REFERENCE, opflex::modb::PropertyInfo::SCALAR);
267  return *this;
268  }
269 
274  bool isTypeSet()
275  {
276  return getObjectInstance().isSet(3670017ul, opflex::modb::PropertyInfo::ENUM8);
277  }
278 
283  boost::optional<const uint8_t> getType()
284  {
285  if (isTypeSet())
286  return (const uint8_t)getObjectInstance().getUInt64(3670017ul);
287  return boost::none;
288  }
289 
295  const uint8_t getType(const uint8_t defaultValue)
296  {
297  return getType().get_value_or(defaultValue);
298  }
299 
309  {
310  getTLMutator().modify(getClassId(), getURI())->setUInt64(3670017ul, newValue);
311  return *this;
312  }
313 
321  {
322  getTLMutator().modify(getClassId(), getURI())->unset(3670017ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
323  return *this;
324  }
325 
337  static boost::optional<boost::shared_ptr<modelgbp::gbp::EpGroupToNetworkRSrc> > resolve(
338  opflex::ofcore::OFFramework& framework,
339  const opflex::modb::URI& uri)
340  {
341  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::EpGroupToNetworkRSrc>(framework, CLASS_ID, uri);
342  }
343 
355  static boost::optional<boost::shared_ptr<modelgbp::gbp::EpGroupToNetworkRSrc> > resolve(
356  const opflex::modb::URI& uri)
357  {
358  return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::EpGroupToNetworkRSrc>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
359  }
360 
379  static boost::optional<boost::shared_ptr<modelgbp::gbp::EpGroupToNetworkRSrc> > resolve(
380  opflex::ofcore::OFFramework& framework,
381  const std::string& policySpaceName,
382  const std::string& gbpEpGroupName)
383  {
384  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpEpGroup").addElement(gbpEpGroupName).addElement("GbpEpGroupToNetworkRSrc").build());
385  }
386 
404  static boost::optional<boost::shared_ptr<modelgbp::gbp::EpGroupToNetworkRSrc> > resolve(
405  const std::string& policySpaceName,
406  const std::string& gbpEpGroupName)
407  {
408  return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpEpGroupName);
409  }
410 
419  void remove()
420  {
421  getTLMutator().remove(CLASS_ID, getURI());
422  }
423 
434  static void remove(opflex::ofcore::OFFramework& framework,
435  const opflex::modb::URI& uri)
436  {
437  MO::remove(framework, CLASS_ID, uri);
438  }
439 
450  static void remove(const opflex::modb::URI& uri)
451  {
452  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
453  }
454 
471  static void remove(
472  opflex::ofcore::OFFramework& framework,
473  const std::string& policySpaceName,
474  const std::string& gbpEpGroupName)
475  {
476  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpEpGroup").addElement(gbpEpGroupName).addElement("GbpEpGroupToNetworkRSrc").build());
477  }
478 
495  static void remove(
496  const std::string& policySpaceName,
497  const std::string& gbpEpGroupName)
498  {
499  remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpEpGroupName);
500  }
501 
513  static void registerListener(
514  opflex::ofcore::OFFramework& framework,
515  opflex::modb::ObjectListener* listener)
516  {
517  opflex::modb::mointernal
518  ::MO::registerListener(framework, listener, CLASS_ID);
519  }
520 
532  static void registerListener(
533  opflex::modb::ObjectListener* listener)
534  {
535  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
536  }
537 
544  static void unregisterListener(
545  opflex::ofcore::OFFramework& framework,
546  opflex::modb::ObjectListener* listener)
547  {
548  opflex::modb::mointernal
549  ::MO::unregisterListener(framework, listener, CLASS_ID);
550  }
551 
558  static void unregisterListener(
559  opflex::modb::ObjectListener* listener)
560  {
561  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
562  }
563 
569  opflex::ofcore::OFFramework& framework,
570  const opflex::modb::URI& uri,
571  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
572  : MO(framework, CLASS_ID, uri, oi) { }
573 }; // class EpGroupToNetworkRSrc
574 
575 } // namespace gbp
576 } // namespace modelgbp
577 #endif // GI_GBP_EPGROUPTONETWORKRSRC_HPP
modelgbp::gbp::EpGroupToNetworkRSrc & setTargetRoutingDomain(const std::string &policySpaceName, const std::string &gbpRoutingDomainName)
Set the reference to point to an instance of RoutingDomain in the currently-active mutator by constru...
Definition: EpGroupToNetworkRSrc.hpp:250
modelgbp::gbp::EpGroupToNetworkRSrc & setTargetFloodDomain(const std::string &policySpaceName, const std::string &gbpFloodDomainName)
Set the reference to point to an instance of FloodDomain in the currently-active mutator by construct...
Definition: EpGroupToNetworkRSrc.hpp:210
modelgbp::gbp::EpGroupToNetworkRSrc & unsetRole()
Unset role in the currently-active mutator.
Definition: EpGroupToNetworkRSrc.hpp:81
boost::optional< const uint8_t > getRole()
Get the value of role if it has been set.
Definition: EpGroupToNetworkRSrc.hpp:44
const uint8_t getType(const uint8_t defaultValue)
Get the value of type if set, otherwise the value of default passed in.
Definition: EpGroupToNetworkRSrc.hpp:295
static boost::optional< boost::shared_ptr< modelgbp::gbp::EpGroupToNetworkRSrc > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpEpGroupName)
Retrieve an instance of EpGroupToNetworkRSrc from the managed object store by constructing its URI fr...
Definition: EpGroupToNetworkRSrc.hpp:379
modelgbp::gbp::EpGroupToNetworkRSrc & unsetTarget()
Unset target in the currently-active mutator.
Definition: EpGroupToNetworkRSrc.hpp:264
static boost::optional< boost::shared_ptr< modelgbp::gbp::EpGroupToNetworkRSrc > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of EpGroupToNetworkRSrc from the managed object store using the default framewor...
Definition: EpGroupToNetworkRSrc.hpp:355
boost::optional< opflex::modb::class_id_t > getTargetClass()
Get the value of targetClass if it has been set.
Definition: EpGroupToNetworkRSrc.hpp:100
modelgbp::gbp::EpGroupToNetworkRSrc & setTargetBridgeDomain(const std::string &policySpaceName, const std::string &gbpBridgeDomainName)
Set the reference to point to an instance of BridgeDomain in the currently-active mutator by construc...
Definition: EpGroupToNetworkRSrc.hpp:170
opflex::modb::URI getTargetURI(opflex::modb::URI defaultValue)
Get the value of targetURI if set, otherwise the value of default passed in.
Definition: EpGroupToNetworkRSrc.hpp:133
modelgbp::gbp::EpGroupToNetworkRSrc & setRole(const uint8_t newValue)
Set role to the specified value in the currently-active mutator.
Definition: EpGroupToNetworkRSrc.hpp:69
EpGroupToNetworkRSrc(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of EpGroupToNetworkRSrc.
Definition: EpGroupToNetworkRSrc.hpp:568
boost::optional< const uint8_t > getType()
Get the value of type if it has been set.
Definition: EpGroupToNetworkRSrc.hpp:283
bool isRoleSet()
Check whether role has been set.
Definition: EpGroupToNetworkRSrc.hpp:35
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: EpGroupToNetworkRSrc.hpp:558
bool isTargetSet()
Check whether target has been set.
Definition: EpGroupToNetworkRSrc.hpp:91
bool isTypeSet()
Check whether type has been set.
Definition: EpGroupToNetworkRSrc.hpp:274
opflex::modb::class_id_t getTargetClass(opflex::modb::class_id_t defaultValue)
Get the value of targetClass if set, otherwise the value of default passed in.
Definition: EpGroupToNetworkRSrc.hpp:123
static boost::optional< boost::shared_ptr< modelgbp::gbp::EpGroupToNetworkRSrc > > resolve(const std::string &policySpaceName, const std::string &gbpEpGroupName)
Retrieve an instance of EpGroupToNetworkRSrc from the default managed object store by constructing it...
Definition: EpGroupToNetworkRSrc.hpp:404
modelgbp::gbp::EpGroupToNetworkRSrc & setTargetRoutingDomain(const opflex::modb::URI &uri)
Set the reference to point to an instance of RoutingDomain with the specified URI.
Definition: EpGroupToNetworkRSrc.hpp:227
Definition: EpGroupToNetworkRSrc.hpp:21
boost::optional< opflex::modb::URI > getTargetURI()
Get the value of targetURI if it has been set.
Definition: EpGroupToNetworkRSrc.hpp:111
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for EpGroupToNetworkRSrc.
Definition: EpGroupToNetworkRSrc.hpp:29
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: EpGroupToNetworkRSrc.hpp:544
modelgbp::gbp::EpGroupToNetworkRSrc & setTargetFloodDomain(const opflex::modb::URI &uri)
Set the reference to point to an instance of FloodDomain with the specified URI.
Definition: EpGroupToNetworkRSrc.hpp:187
modelgbp::gbp::EpGroupToNetworkRSrc & setType(const uint8_t newValue)
Set type to the specified value in the currently-active mutator.
Definition: EpGroupToNetworkRSrc.hpp:308
modelgbp::gbp::EpGroupToNetworkRSrc & setTargetBridgeDomain(const opflex::modb::URI &uri)
Set the reference to point to an instance of BridgeDomain with the specified URI. ...
Definition: EpGroupToNetworkRSrc.hpp:147
static void registerListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class.
Definition: EpGroupToNetworkRSrc.hpp:513
static boost::optional< boost::shared_ptr< modelgbp::gbp::EpGroupToNetworkRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpGroupToNetworkRSrc from the managed object store.
Definition: EpGroupToNetworkRSrc.hpp:337
modelgbp::gbp::EpGroupToNetworkRSrc & unsetType()
Unset type in the currently-active mutator.
Definition: EpGroupToNetworkRSrc.hpp:320
static void registerListener(opflex::modb::ObjectListener *listener)
Register a listener that will get called for changes related to this class with the default framework...
Definition: EpGroupToNetworkRSrc.hpp:532
const uint8_t getRole(const uint8_t defaultValue)
Get the value of role if set, otherwise the value of default passed in.
Definition: EpGroupToNetworkRSrc.hpp:56