modelgbp Generated OpFlex Model  1.2.0
LocalL2Ep.hpp
1 
10 #pragma once
11 #ifndef GI_EPDR_LOCALL2EP_HPP
12 #define GI_EPDR_LOCALL2EP_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 /*
18  * contains: item:mclass(gbpe/EpgMappingCtx)
19  */
20 #include "modelgbp/gbpe/EpgMappingCtx.hpp"
21 /*
22  * contains: item:mclass(epdr/EndPointToGroupRSrc)
23  */
24 #include "modelgbp/epdr/EndPointToGroupRSrc.hpp"
25 
26 namespace modelgbp {
27 namespace epdr {
28 
29 class LocalL2Ep
30  : public opflex::modb::mointernal::MO
31 {
32 public:
33 
37  static const opflex::modb::class_id_t CLASS_ID = 88;
38 
43  bool isMacSet()
44  {
45  return getObjectInstance().isSet(2883586ul, opflex::modb::PropertyInfo::MAC);
46  }
47 
52  boost::optional<const opflex::modb::MAC&> getMac()
53  {
54  if (isMacSet())
55  return getObjectInstance().getMAC(2883586ul);
56  return boost::none;
57  }
58 
64  const opflex::modb::MAC& getMac(const opflex::modb::MAC& defaultValue)
65  {
66  return getMac().get_value_or(defaultValue);
67  }
68 
77  modelgbp::epdr::LocalL2Ep& setMac(const opflex::modb::MAC& newValue)
78  {
79  getTLMutator().modify(getClassId(), getURI())->setMAC(2883586ul, newValue);
80  return *this;
81  }
82 
90  {
91  getTLMutator().modify(getClassId(), getURI())->unset(2883586ul, opflex::modb::PropertyInfo::MAC, opflex::modb::PropertyInfo::SCALAR);
92  return *this;
93  }
94 
99  bool isUuidSet()
100  {
101  return getObjectInstance().isSet(2883585ul, opflex::modb::PropertyInfo::STRING);
102  }
103 
108  boost::optional<const std::string&> getUuid()
109  {
110  if (isUuidSet())
111  return getObjectInstance().getString(2883585ul);
112  return boost::none;
113  }
114 
120  const std::string& getUuid(const std::string& defaultValue)
121  {
122  return getUuid().get_value_or(defaultValue);
123  }
124 
133  modelgbp::epdr::LocalL2Ep& setUuid(const std::string& newValue)
134  {
135  getTLMutator().modify(getClassId(), getURI())->setString(2883585ul, newValue);
136  return *this;
137  }
138 
146  {
147  getTLMutator().modify(getClassId(), getURI())->unset(2883585ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
148  return *this;
149  }
150 
162  static boost::optional<boost::shared_ptr<modelgbp::epdr::LocalL2Ep> > resolve(
163  opflex::ofcore::OFFramework& framework,
164  const opflex::modb::URI& uri)
165  {
166  return opflex::modb::mointernal::MO::resolve<modelgbp::epdr::LocalL2Ep>(framework, CLASS_ID, uri);
167  }
168 
180  static boost::optional<boost::shared_ptr<modelgbp::epdr::LocalL2Ep> > resolve(
181  const opflex::modb::URI& uri)
182  {
183  return opflex::modb::mointernal::MO::resolve<modelgbp::epdr::LocalL2Ep>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
184  }
185 
202  static boost::optional<boost::shared_ptr<modelgbp::epdr::LocalL2Ep> > resolve(
203  opflex::ofcore::OFFramework& framework,
204  const std::string& epdrLocalL2EpUuid)
205  {
206  return resolve(framework,opflex::modb::URIBuilder().addElement("EpdrL2Discovered").addElement("EpdrLocalL2Ep").addElement(epdrLocalL2EpUuid).build());
207  }
208 
224  static boost::optional<boost::shared_ptr<modelgbp::epdr::LocalL2Ep> > resolve(
225  const std::string& epdrLocalL2EpUuid)
226  {
227  return resolve(opflex::ofcore::OFFramework::defaultInstance(),epdrLocalL2EpUuid);
228  }
229 
239  boost::optional<boost::shared_ptr<modelgbp::gbpe::EpgMappingCtx> > resolveGbpeEpgMappingCtx(
240  )
241  {
242  return modelgbp::gbpe::EpgMappingCtx::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("GbpeEpgMappingCtx").build());
243  }
244 
255  boost::shared_ptr<modelgbp::gbpe::EpgMappingCtx> addGbpeEpgMappingCtx(
256  )
257  {
258  boost::shared_ptr<modelgbp::gbpe::EpgMappingCtx> result = addChild<modelgbp::gbpe::EpgMappingCtx>(
259  CLASS_ID, getURI(), 2150367245ul, 13,
260  opflex::modb::URIBuilder(getURI()).addElement("GbpeEpgMappingCtx").build()
261  );
262  return result;
263  }
264 
274  boost::optional<boost::shared_ptr<modelgbp::epdr::EndPointToGroupRSrc> > resolveEpdrEndPointToGroupRSrc(
275  )
276  {
277  return modelgbp::epdr::EndPointToGroupRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("EpdrEndPointToGroupRSrc").build());
278  }
279 
290  boost::shared_ptr<modelgbp::epdr::EndPointToGroupRSrc> addEpdrEndPointToGroupRSrc(
291  )
292  {
293  boost::shared_ptr<modelgbp::epdr::EndPointToGroupRSrc> result = addChild<modelgbp::epdr::EndPointToGroupRSrc>(
294  CLASS_ID, getURI(), 2150367317ul, 85,
295  opflex::modb::URIBuilder(getURI()).addElement("EpdrEndPointToGroupRSrc").build()
296  );
297  return result;
298  }
299 
308  void remove()
309  {
310  getTLMutator().remove(CLASS_ID, getURI());
311  }
312 
323  static void remove(opflex::ofcore::OFFramework& framework,
324  const opflex::modb::URI& uri)
325  {
326  MO::remove(framework, CLASS_ID, uri);
327  }
328 
339  static void remove(const opflex::modb::URI& uri)
340  {
341  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
342  }
343 
358  static void remove(
359  opflex::ofcore::OFFramework& framework,
360  const std::string& epdrLocalL2EpUuid)
361  {
362  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("EpdrL2Discovered").addElement("EpdrLocalL2Ep").addElement(epdrLocalL2EpUuid).build());
363  }
364 
379  static void remove(
380  const std::string& epdrLocalL2EpUuid)
381  {
382  remove(opflex::ofcore::OFFramework::defaultInstance(),epdrLocalL2EpUuid);
383  }
384 
396  static void registerListener(
397  opflex::ofcore::OFFramework& framework,
398  opflex::modb::ObjectListener* listener)
399  {
400  opflex::modb::mointernal
401  ::MO::registerListener(framework, listener, CLASS_ID);
402  }
403 
415  static void registerListener(
416  opflex::modb::ObjectListener* listener)
417  {
418  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
419  }
420 
427  static void unregisterListener(
428  opflex::ofcore::OFFramework& framework,
429  opflex::modb::ObjectListener* listener)
430  {
431  opflex::modb::mointernal
432  ::MO::unregisterListener(framework, listener, CLASS_ID);
433  }
434 
441  static void unregisterListener(
442  opflex::modb::ObjectListener* listener)
443  {
444  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
445  }
446 
452  opflex::ofcore::OFFramework& framework,
453  const opflex::modb::URI& uri,
454  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
455  : MO(framework, CLASS_ID, uri, oi) { }
456 }; // class LocalL2Ep
457 
458 } // namespace epdr
459 } // namespace modelgbp
460 #endif // GI_EPDR_LOCALL2EP_HPP
modelgbp::epdr::LocalL2Ep & unsetUuid()
Unset uuid in the currently-active mutator.
Definition: LocalL2Ep.hpp:145
const opflex::modb::MAC & getMac(const opflex::modb::MAC &defaultValue)
Get the value of mac if set, otherwise the value of default passed in.
Definition: LocalL2Ep.hpp:64
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: LocalL2Ep.hpp:396
boost::optional< const opflex::modb::MAC & > getMac()
Get the value of mac if it has been set.
Definition: LocalL2Ep.hpp:52
modelgbp::epdr::LocalL2Ep & setMac(const opflex::modb::MAC &newValue)
Set mac to the specified value in the currently-active mutator.
Definition: LocalL2Ep.hpp:77
modelgbp::epdr::LocalL2Ep & setUuid(const std::string &newValue)
Set uuid to the specified value in the currently-active mutator.
Definition: LocalL2Ep.hpp:133
static boost::optional< boost::shared_ptr< modelgbp::epdr::LocalL2Ep > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of LocalL2Ep from the managed object store using the default framework instance...
Definition: LocalL2Ep.hpp:180
const std::string & getUuid(const std::string &defaultValue)
Get the value of uuid if set, otherwise the value of default passed in.
Definition: LocalL2Ep.hpp:120
bool isMacSet()
Check whether mac has been set.
Definition: LocalL2Ep.hpp:43
static boost::optional< boost::shared_ptr< modelgbp::epdr::LocalL2Ep > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalL2Ep from the managed object store.
Definition: LocalL2Ep.hpp:162
LocalL2Ep(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of LocalL2Ep.
Definition: LocalL2Ep.hpp:451
static boost::optional< boost::shared_ptr< modelgbp::epdr::LocalL2Ep > > resolve(const std::string &epdrLocalL2EpUuid)
Retrieve an instance of LocalL2Ep from the default managed object store by constructing its URI from ...
Definition: LocalL2Ep.hpp:224
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for LocalL2Ep.
Definition: LocalL2Ep.hpp:37
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: LocalL2Ep.hpp:415
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: LocalL2Ep.hpp:441
static boost::optional< boost::shared_ptr< modelgbp::epdr::EndPointToGroupRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EndPointToGroupRSrc from the managed object store.
Definition: EndPointToGroupRSrc.hpp:257
boost::shared_ptr< modelgbp::gbpe::EpgMappingCtx > addGbpeEpgMappingCtx()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: LocalL2Ep.hpp:255
Definition: LocalL2Ep.hpp:29
boost::shared_ptr< modelgbp::epdr::EndPointToGroupRSrc > addEpdrEndPointToGroupRSrc()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: LocalL2Ep.hpp:290
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: LocalL2Ep.hpp:427
static boost::optional< boost::shared_ptr< modelgbp::epdr::LocalL2Ep > > resolve(opflex::ofcore::OFFramework &framework, const std::string &epdrLocalL2EpUuid)
Retrieve an instance of LocalL2Ep from the managed object store by constructing its URI from the path...
Definition: LocalL2Ep.hpp:202
boost::optional< boost::shared_ptr< modelgbp::epdr::EndPointToGroupRSrc > > resolveEpdrEndPointToGroupRSrc()
Retrieve the child object with the specified naming properties.
Definition: LocalL2Ep.hpp:274
boost::optional< const std::string & > getUuid()
Get the value of uuid if it has been set.
Definition: LocalL2Ep.hpp:108
boost::optional< boost::shared_ptr< modelgbp::gbpe::EpgMappingCtx > > resolveGbpeEpgMappingCtx()
Retrieve the child object with the specified naming properties.
Definition: LocalL2Ep.hpp:239
modelgbp::epdr::LocalL2Ep & unsetMac()
Unset mac in the currently-active mutator.
Definition: LocalL2Ep.hpp:89
bool isUuidSet()
Check whether uuid has been set.
Definition: LocalL2Ep.hpp:99
static boost::optional< boost::shared_ptr< modelgbp::gbpe::EpgMappingCtx > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpgMappingCtx from the managed object store.
Definition: EpgMappingCtx.hpp:50
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12