modelgbp Generated OpFlex Model  1.3.0
InstContext.hpp
1 
10 #pragma once
11 #ifndef GI_GBPE_INSTCONTEXT_HPP
12 #define GI_GBPE_INSTCONTEXT_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 gbpe {
20 
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 29;
30 
35  bool isClassidSet()
36  {
37  return getObjectInstance().isSet(950273ul, opflex::modb::PropertyInfo::U64);
38  }
39 
44  boost::optional<uint32_t> getClassid()
45  {
46  if (isClassidSet())
47  return (uint32_t)getObjectInstance().getUInt64(950273ul);
48  return boost::none;
49  }
50 
56  uint32_t getClassid(uint32_t defaultValue)
57  {
58  return getClassid().get_value_or(defaultValue);
59  }
60 
70  {
71  getTLMutator().modify(getClassId(), getURI())->setUInt64(950273ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(950273ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
91  bool isEncapIdSet()
92  {
93  return getObjectInstance().isSet(950274ul, opflex::modb::PropertyInfo::U64);
94  }
95 
100  boost::optional<uint32_t> getEncapId()
101  {
102  if (isEncapIdSet())
103  return (uint32_t)getObjectInstance().getUInt64(950274ul);
104  return boost::none;
105  }
106 
112  uint32_t getEncapId(uint32_t defaultValue)
113  {
114  return getEncapId().get_value_or(defaultValue);
115  }
116 
126  {
127  getTLMutator().modify(getClassId(), getURI())->setUInt64(950274ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(950274ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
148  {
149  return getObjectInstance().isSet(950275ul, opflex::modb::PropertyInfo::STRING);
150  }
151 
156  boost::optional<const std::string&> getMulticastGroupIP()
157  {
158  if (isMulticastGroupIPSet())
159  return getObjectInstance().getString(950275ul);
160  return boost::none;
161  }
162 
168  const std::string& getMulticastGroupIP(const std::string& defaultValue)
169  {
170  return getMulticastGroupIP().get_value_or(defaultValue);
171  }
172 
181  modelgbp::gbpe::InstContext& setMulticastGroupIP(const std::string& newValue)
182  {
183  getTLMutator().modify(getClassId(), getURI())->setString(950275ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(950275ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
210  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolve(
211  opflex::ofcore::OFFramework& framework,
212  const opflex::modb::URI& uri)
213  {
214  return opflex::modb::mointernal::MO::resolve<modelgbp::gbpe::InstContext>(framework, CLASS_ID, uri);
215  }
216 
228  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolve(
229  const opflex::modb::URI& uri)
230  {
231  return opflex::modb::mointernal::MO::resolve<modelgbp::gbpe::InstContext>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
232  }
233 
252  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolveUnderPolicyUniversePolicySpaceGbpEpGroup(
253  opflex::ofcore::OFFramework& framework,
254  const std::string& policySpaceName,
255  const std::string& gbpEpGroupName)
256  {
257  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpEpGroup").addElement(gbpEpGroupName).addElement("GbpeInstContext").build());
258  }
259 
277  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolveUnderPolicyUniversePolicySpaceGbpEpGroup(
278  const std::string& policySpaceName,
279  const std::string& gbpEpGroupName)
280  {
281  return resolveUnderPolicyUniversePolicySpaceGbpEpGroup(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpEpGroupName);
282  }
283 
302  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolveUnderPolicyUniversePolicySpaceGbpBridgeDomain(
303  opflex::ofcore::OFFramework& framework,
304  const std::string& policySpaceName,
305  const std::string& gbpBridgeDomainName)
306  {
307  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpBridgeDomain").addElement(gbpBridgeDomainName).addElement("GbpeInstContext").build());
308  }
309 
327  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolveUnderPolicyUniversePolicySpaceGbpBridgeDomain(
328  const std::string& policySpaceName,
329  const std::string& gbpBridgeDomainName)
330  {
331  return resolveUnderPolicyUniversePolicySpaceGbpBridgeDomain(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpBridgeDomainName);
332  }
333 
352  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolveUnderPolicyUniversePolicySpaceGbpRoutingDomain(
353  opflex::ofcore::OFFramework& framework,
354  const std::string& policySpaceName,
355  const std::string& gbpRoutingDomainName)
356  {
357  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("GbpeInstContext").build());
358  }
359 
377  static boost::optional<boost::shared_ptr<modelgbp::gbpe::InstContext> > resolveUnderPolicyUniversePolicySpaceGbpRoutingDomain(
378  const std::string& policySpaceName,
379  const std::string& gbpRoutingDomainName)
380  {
381  return resolveUnderPolicyUniversePolicySpaceGbpRoutingDomain(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName);
382  }
383 
392  void remove()
393  {
394  getTLMutator().remove(CLASS_ID, getURI());
395  }
396 
407  static void remove(opflex::ofcore::OFFramework& framework,
408  const opflex::modb::URI& uri)
409  {
410  MO::remove(framework, CLASS_ID, uri);
411  }
412 
423  static void remove(const opflex::modb::URI& uri)
424  {
425  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
426  }
427 
445  opflex::ofcore::OFFramework& framework,
446  const std::string& policySpaceName,
447  const std::string& gbpEpGroupName)
448  {
449  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpEpGroup").addElement(gbpEpGroupName).addElement("GbpeInstContext").build());
450  }
451 
469  const std::string& policySpaceName,
470  const std::string& gbpEpGroupName)
471  {
472  removeUnderPolicyUniversePolicySpaceGbpEpGroup(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpEpGroupName);
473  }
474 
492  opflex::ofcore::OFFramework& framework,
493  const std::string& policySpaceName,
494  const std::string& gbpBridgeDomainName)
495  {
496  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpBridgeDomain").addElement(gbpBridgeDomainName).addElement("GbpeInstContext").build());
497  }
498 
516  const std::string& policySpaceName,
517  const std::string& gbpBridgeDomainName)
518  {
519  removeUnderPolicyUniversePolicySpaceGbpBridgeDomain(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpBridgeDomainName);
520  }
521 
539  opflex::ofcore::OFFramework& framework,
540  const std::string& policySpaceName,
541  const std::string& gbpRoutingDomainName)
542  {
543  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PolicySpace").addElement(policySpaceName).addElement("GbpRoutingDomain").addElement(gbpRoutingDomainName).addElement("GbpeInstContext").build());
544  }
545 
563  const std::string& policySpaceName,
564  const std::string& gbpRoutingDomainName)
565  {
566  removeUnderPolicyUniversePolicySpaceGbpRoutingDomain(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpRoutingDomainName);
567  }
568 
580  static void registerListener(
581  opflex::ofcore::OFFramework& framework,
582  opflex::modb::ObjectListener* listener)
583  {
584  opflex::modb::mointernal
585  ::MO::registerListener(framework, listener, CLASS_ID);
586  }
587 
599  static void registerListener(
600  opflex::modb::ObjectListener* listener)
601  {
602  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
603  }
604 
611  static void unregisterListener(
612  opflex::ofcore::OFFramework& framework,
613  opflex::modb::ObjectListener* listener)
614  {
615  opflex::modb::mointernal
616  ::MO::unregisterListener(framework, listener, CLASS_ID);
617  }
618 
625  static void unregisterListener(
626  opflex::modb::ObjectListener* listener)
627  {
628  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
629  }
630 
636  opflex::ofcore::OFFramework& framework,
637  const opflex::modb::URI& uri,
638  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
639  : MO(framework, CLASS_ID, uri, oi) { }
640 }; // class InstContext
641 
642 } // namespace gbpe
643 } // namespace modelgbp
644 #endif // GI_GBPE_INSTCONTEXT_HPP
modelgbp::gbpe::InstContext & setMulticastGroupIP(const std::string &newValue)
Set multicastGroupIP to the specified value in the currently-active mutator.
Definition: InstContext.hpp:181
InstContext(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of InstContext.
Definition: InstContext.hpp:635
modelgbp::gbpe::InstContext & unsetClassid()
Unset classid in the currently-active mutator.
Definition: InstContext.hpp:81
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of InstContext from the managed object store using the default framework instanc...
Definition: InstContext.hpp:228
boost::optional< uint32_t > getClassid()
Get the value of classid if it has been set.
Definition: InstContext.hpp:44
boost::optional< uint32_t > getEncapId()
Get the value of encapId if it has been set.
Definition: InstContext.hpp:100
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolveUnderPolicyUniversePolicySpaceGbpEpGroup(const std::string &policySpaceName, const std::string &gbpEpGroupName)
Retrieve an instance of InstContext from the default managed object store by constructing its URI fro...
Definition: InstContext.hpp:277
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolveUnderPolicyUniversePolicySpaceGbpEpGroup(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpEpGroupName)
Retrieve an instance of InstContext from the managed object store by constructing its URI from the pa...
Definition: InstContext.hpp:252
static void removeUnderPolicyUniversePolicySpaceGbpBridgeDomain(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpBridgeDomainName)
Remove the InstContext object with the specified path elements from the managed object store...
Definition: InstContext.hpp:491
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: InstContext.hpp:611
modelgbp::gbpe::InstContext & unsetEncapId()
Unset encapId in the currently-active mutator.
Definition: InstContext.hpp:137
static void removeUnderPolicyUniversePolicySpaceGbpRoutingDomain(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpRoutingDomainName)
Remove the InstContext object with the specified path elements from the managed object store...
Definition: InstContext.hpp:538
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of InstContext from the managed object store.
Definition: InstContext.hpp:210
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolveUnderPolicyUniversePolicySpaceGbpRoutingDomain(const std::string &policySpaceName, const std::string &gbpRoutingDomainName)
Retrieve an instance of InstContext from the default managed object store by constructing its URI fro...
Definition: InstContext.hpp:377
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: InstContext.hpp:625
modelgbp::gbpe::InstContext & setClassid(uint32_t newValue)
Set classid to the specified value in the currently-active mutator.
Definition: InstContext.hpp:69
const std::string & getMulticastGroupIP(const std::string &defaultValue)
Get the value of multicastGroupIP if set, otherwise the value of default passed in.
Definition: InstContext.hpp:168
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolveUnderPolicyUniversePolicySpaceGbpBridgeDomain(const std::string &policySpaceName, const std::string &gbpBridgeDomainName)
Retrieve an instance of InstContext from the default managed object store by constructing its URI fro...
Definition: InstContext.hpp:327
modelgbp::gbpe::InstContext & unsetMulticastGroupIP()
Unset multicastGroupIP in the currently-active mutator.
Definition: InstContext.hpp:193
static void removeUnderPolicyUniversePolicySpaceGbpEpGroup(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpEpGroupName)
Remove the InstContext object with the specified path elements from the managed object store...
Definition: InstContext.hpp:444
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: InstContext.hpp:580
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for InstContext.
Definition: InstContext.hpp:29
Definition: InstContext.hpp:21
uint32_t getClassid(uint32_t defaultValue)
Get the value of classid if set, otherwise the value of default passed in.
Definition: InstContext.hpp:56
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: InstContext.hpp:599
boost::optional< const std::string & > getMulticastGroupIP()
Get the value of multicastGroupIP if it has been set.
Definition: InstContext.hpp:156
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolveUnderPolicyUniversePolicySpaceGbpRoutingDomain(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpRoutingDomainName)
Retrieve an instance of InstContext from the managed object store by constructing its URI from the pa...
Definition: InstContext.hpp:352
uint32_t getEncapId(uint32_t defaultValue)
Get the value of encapId if set, otherwise the value of default passed in.
Definition: InstContext.hpp:112
bool isMulticastGroupIPSet()
Check whether multicastGroupIP has been set.
Definition: InstContext.hpp:147
static void removeUnderPolicyUniversePolicySpaceGbpEpGroup(const std::string &policySpaceName, const std::string &gbpEpGroupName)
Remove the InstContext object with the specified path elements from the managed object store using th...
Definition: InstContext.hpp:468
modelgbp::gbpe::InstContext & setEncapId(uint32_t newValue)
Set encapId to the specified value in the currently-active mutator.
Definition: InstContext.hpp:125
static void removeUnderPolicyUniversePolicySpaceGbpRoutingDomain(const std::string &policySpaceName, const std::string &gbpRoutingDomainName)
Remove the InstContext object with the specified path elements from the managed object store using th...
Definition: InstContext.hpp:562
static void removeUnderPolicyUniversePolicySpaceGbpBridgeDomain(const std::string &policySpaceName, const std::string &gbpBridgeDomainName)
Remove the InstContext object with the specified path elements from the managed object store using th...
Definition: InstContext.hpp:515
bool isEncapIdSet()
Check whether encapId has been set.
Definition: InstContext.hpp:91
bool isClassidSet()
Check whether classid has been set.
Definition: InstContext.hpp:35
static boost::optional< boost::shared_ptr< modelgbp::gbpe::InstContext > > resolveUnderPolicyUniversePolicySpaceGbpBridgeDomain(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpBridgeDomainName)
Retrieve an instance of InstContext from the managed object store by constructing its URI from the pa...
Definition: InstContext.hpp:302