modelgbp Generated OpFlex Model  1.2.0
L2Ep.hpp
1 
10 #pragma once
11 #ifndef GI_EPR_L2EP_HPP
12 #define GI_EPR_L2EP_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/Attestation)
19  */
20 #include "modelgbp/gbpe/Attestation.hpp"
21 /*
22  * contains: item:mclass(span/LocalEpFromEpRTgt)
23  */
24 #include "modelgbp/span/LocalEpFromEpRTgt.hpp"
25 /*
26  * contains: item:mclass(epr/L3Net)
27  */
28 #include "modelgbp/epr/L3Net.hpp"
29 
30 namespace modelgbp {
31 namespace epr {
32 
33 class L2Ep
34  : public opflex::modb::mointernal::MO
35 {
36 public:
37 
41  static const opflex::modb::class_id_t CLASS_ID = 81;
42 
47  bool isContextSet()
48  {
49  return getObjectInstance().isSet(2654212ul, opflex::modb::PropertyInfo::STRING);
50  }
51 
56  boost::optional<const std::string&> getContext()
57  {
58  if (isContextSet())
59  return getObjectInstance().getString(2654212ul);
60  return boost::none;
61  }
62 
68  const std::string& getContext(const std::string& defaultValue)
69  {
70  return getContext().get_value_or(defaultValue);
71  }
72 
81  modelgbp::epr::L2Ep& setContext(const std::string& newValue)
82  {
83  getTLMutator().modify(getClassId(), getURI())->setString(2654212ul, newValue);
84  return *this;
85  }
86 
94  {
95  getTLMutator().modify(getClassId(), getURI())->unset(2654212ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
96  return *this;
97  }
98 
103  bool isGroupSet()
104  {
105  return getObjectInstance().isSet(2654211ul, opflex::modb::PropertyInfo::STRING);
106  }
107 
112  boost::optional<const std::string&> getGroup()
113  {
114  if (isGroupSet())
115  return getObjectInstance().getString(2654211ul);
116  return boost::none;
117  }
118 
124  const std::string& getGroup(const std::string& defaultValue)
125  {
126  return getGroup().get_value_or(defaultValue);
127  }
128 
137  modelgbp::epr::L2Ep& setGroup(const std::string& newValue)
138  {
139  getTLMutator().modify(getClassId(), getURI())->setString(2654211ul, newValue);
140  return *this;
141  }
142 
150  {
151  getTLMutator().modify(getClassId(), getURI())->unset(2654211ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
152  return *this;
153  }
154 
160  {
161  return getObjectInstance().isSet(2654213ul, opflex::modb::PropertyInfo::STRING);
162  }
163 
168  boost::optional<const std::string&> getInterfaceName()
169  {
170  if (isInterfaceNameSet())
171  return getObjectInstance().getString(2654213ul);
172  return boost::none;
173  }
174 
180  const std::string& getInterfaceName(const std::string& defaultValue)
181  {
182  return getInterfaceName().get_value_or(defaultValue);
183  }
184 
193  modelgbp::epr::L2Ep& setInterfaceName(const std::string& newValue)
194  {
195  getTLMutator().modify(getClassId(), getURI())->setString(2654213ul, newValue);
196  return *this;
197  }
198 
206  {
207  getTLMutator().modify(getClassId(), getURI())->unset(2654213ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
208  return *this;
209  }
210 
215  bool isMacSet()
216  {
217  return getObjectInstance().isSet(2654210ul, opflex::modb::PropertyInfo::MAC);
218  }
219 
224  boost::optional<const opflex::modb::MAC&> getMac()
225  {
226  if (isMacSet())
227  return getObjectInstance().getMAC(2654210ul);
228  return boost::none;
229  }
230 
236  const opflex::modb::MAC& getMac(const opflex::modb::MAC& defaultValue)
237  {
238  return getMac().get_value_or(defaultValue);
239  }
240 
249  modelgbp::epr::L2Ep& setMac(const opflex::modb::MAC& newValue)
250  {
251  getTLMutator().modify(getClassId(), getURI())->setMAC(2654210ul, newValue);
252  return *this;
253  }
254 
262  {
263  getTLMutator().modify(getClassId(), getURI())->unset(2654210ul, opflex::modb::PropertyInfo::MAC, opflex::modb::PropertyInfo::SCALAR);
264  return *this;
265  }
266 
271  bool isUuidSet()
272  {
273  return getObjectInstance().isSet(2654209ul, opflex::modb::PropertyInfo::STRING);
274  }
275 
280  boost::optional<const std::string&> getUuid()
281  {
282  if (isUuidSet())
283  return getObjectInstance().getString(2654209ul);
284  return boost::none;
285  }
286 
292  const std::string& getUuid(const std::string& defaultValue)
293  {
294  return getUuid().get_value_or(defaultValue);
295  }
296 
305  modelgbp::epr::L2Ep& setUuid(const std::string& newValue)
306  {
307  getTLMutator().modify(getClassId(), getURI())->setString(2654209ul, newValue);
308  return *this;
309  }
310 
318  {
319  getTLMutator().modify(getClassId(), getURI())->unset(2654209ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
320  return *this;
321  }
322 
327  bool isVmNameSet()
328  {
329  return getObjectInstance().isSet(2654214ul, opflex::modb::PropertyInfo::STRING);
330  }
331 
336  boost::optional<const std::string&> getVmName()
337  {
338  if (isVmNameSet())
339  return getObjectInstance().getString(2654214ul);
340  return boost::none;
341  }
342 
348  const std::string& getVmName(const std::string& defaultValue)
349  {
350  return getVmName().get_value_or(defaultValue);
351  }
352 
361  modelgbp::epr::L2Ep& setVmName(const std::string& newValue)
362  {
363  getTLMutator().modify(getClassId(), getURI())->setString(2654214ul, newValue);
364  return *this;
365  }
366 
374  {
375  getTLMutator().modify(getClassId(), getURI())->unset(2654214ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
376  return *this;
377  }
378 
390  static boost::optional<boost::shared_ptr<modelgbp::epr::L2Ep> > resolve(
391  opflex::ofcore::OFFramework& framework,
392  const opflex::modb::URI& uri)
393  {
394  return opflex::modb::mointernal::MO::resolve<modelgbp::epr::L2Ep>(framework, CLASS_ID, uri);
395  }
396 
408  static boost::optional<boost::shared_ptr<modelgbp::epr::L2Ep> > resolve(
409  const opflex::modb::URI& uri)
410  {
411  return opflex::modb::mointernal::MO::resolve<modelgbp::epr::L2Ep>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
412  }
413 
432  static boost::optional<boost::shared_ptr<modelgbp::epr::L2Ep> > resolve(
433  opflex::ofcore::OFFramework& framework,
434  const std::string& eprL2EpContext,
435  const opflex::modb::MAC& eprL2EpMac)
436  {
437  return resolve(framework,opflex::modb::URIBuilder().addElement("EprL2Universe").addElement("EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).build());
438  }
439 
457  static boost::optional<boost::shared_ptr<modelgbp::epr::L2Ep> > resolve(
458  const std::string& eprL2EpContext,
459  const opflex::modb::MAC& eprL2EpMac)
460  {
461  return resolve(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac);
462  }
463 
475  boost::optional<boost::shared_ptr<modelgbp::gbpe::Attestation> > resolveGbpeAttestation(
476  const std::string& gbpeAttestationName)
477  {
478  return modelgbp::gbpe::Attestation::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("GbpeAttestation").addElement(gbpeAttestationName).build());
479  }
480 
493  boost::shared_ptr<modelgbp::gbpe::Attestation> addGbpeAttestation(
494  const std::string& gbpeAttestationName)
495  {
496  boost::shared_ptr<modelgbp::gbpe::Attestation> result = addChild<modelgbp::gbpe::Attestation>(
497  CLASS_ID, getURI(), 2150137892ul, 36,
498  opflex::modb::URIBuilder(getURI()).addElement("GbpeAttestation").addElement(gbpeAttestationName).build()
499  );
500  result->setName(gbpeAttestationName);
501  return result;
502  }
503 
518  void resolveGbpeAttestation(/* out */ std::vector<boost::shared_ptr<modelgbp::gbpe::Attestation> >& out)
519  {
520  opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbpe::Attestation>(
521  getFramework(), CLASS_ID, getURI(), 2150137892ul, 36, out);
522  }
523 
535  boost::optional<boost::shared_ptr<modelgbp::span::LocalEpFromEpRTgt> > resolveSpanLocalEpFromEpRTgt(
536  const std::string& spanLocalEpFromEpRTgtSource)
537  {
538  return modelgbp::span::LocalEpFromEpRTgt::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("SpanLocalEpFromEpRTgt").addElement(spanLocalEpFromEpRTgtSource).build());
539  }
540 
553  boost::shared_ptr<modelgbp::span::LocalEpFromEpRTgt> addSpanLocalEpFromEpRTgt(
554  const std::string& spanLocalEpFromEpRTgtSource)
555  {
556  boost::shared_ptr<modelgbp::span::LocalEpFromEpRTgt> result = addChild<modelgbp::span::LocalEpFromEpRTgt>(
557  CLASS_ID, getURI(), 2150137910ul, 54,
558  opflex::modb::URIBuilder(getURI()).addElement("SpanLocalEpFromEpRTgt").addElement(spanLocalEpFromEpRTgtSource).build()
559  );
560  result->setSource(spanLocalEpFromEpRTgtSource);
561  return result;
562  }
563 
578  void resolveSpanLocalEpFromEpRTgt(/* out */ std::vector<boost::shared_ptr<modelgbp::span::LocalEpFromEpRTgt> >& out)
579  {
580  opflex::modb::mointernal::MO::resolveChildren<modelgbp::span::LocalEpFromEpRTgt>(
581  getFramework(), CLASS_ID, getURI(), 2150137910ul, 54, out);
582  }
583 
595  boost::optional<boost::shared_ptr<modelgbp::epr::L3Net> > resolveEprL3Net(
596  const std::string& eprL3NetIp)
597  {
598  return modelgbp::epr::L3Net::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("EprL3Net").addElement(eprL3NetIp).build());
599  }
600 
613  boost::shared_ptr<modelgbp::epr::L3Net> addEprL3Net(
614  const std::string& eprL3NetIp)
615  {
616  boost::shared_ptr<modelgbp::epr::L3Net> result = addChild<modelgbp::epr::L3Net>(
617  CLASS_ID, getURI(), 2150137938ul, 82,
618  opflex::modb::URIBuilder(getURI()).addElement("EprL3Net").addElement(eprL3NetIp).build()
619  );
620  result->setIp(eprL3NetIp);
621  return result;
622  }
623 
638  void resolveEprL3Net(/* out */ std::vector<boost::shared_ptr<modelgbp::epr::L3Net> >& out)
639  {
640  opflex::modb::mointernal::MO::resolveChildren<modelgbp::epr::L3Net>(
641  getFramework(), CLASS_ID, getURI(), 2150137938ul, 82, out);
642  }
643 
652  void remove()
653  {
654  getTLMutator().remove(CLASS_ID, getURI());
655  }
656 
667  static void remove(opflex::ofcore::OFFramework& framework,
668  const opflex::modb::URI& uri)
669  {
670  MO::remove(framework, CLASS_ID, uri);
671  }
672 
683  static void remove(const opflex::modb::URI& uri)
684  {
685  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
686  }
687 
704  static void remove(
705  opflex::ofcore::OFFramework& framework,
706  const std::string& eprL2EpContext,
707  const opflex::modb::MAC& eprL2EpMac)
708  {
709  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("EprL2Universe").addElement("EprL2Ep").addElement(eprL2EpContext).addElement(eprL2EpMac).build());
710  }
711 
728  static void remove(
729  const std::string& eprL2EpContext,
730  const opflex::modb::MAC& eprL2EpMac)
731  {
732  remove(opflex::ofcore::OFFramework::defaultInstance(),eprL2EpContext,eprL2EpMac);
733  }
734 
746  static void registerListener(
747  opflex::ofcore::OFFramework& framework,
748  opflex::modb::ObjectListener* listener)
749  {
750  opflex::modb::mointernal
751  ::MO::registerListener(framework, listener, CLASS_ID);
752  }
753 
765  static void registerListener(
766  opflex::modb::ObjectListener* listener)
767  {
768  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
769  }
770 
777  static void unregisterListener(
778  opflex::ofcore::OFFramework& framework,
779  opflex::modb::ObjectListener* listener)
780  {
781  opflex::modb::mointernal
782  ::MO::unregisterListener(framework, listener, CLASS_ID);
783  }
784 
791  static void unregisterListener(
792  opflex::modb::ObjectListener* listener)
793  {
794  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
795  }
796 
802  opflex::ofcore::OFFramework& framework,
803  const opflex::modb::URI& uri,
804  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
805  : MO(framework, CLASS_ID, uri, oi) { }
806 }; // class L2Ep
807 
808 } // namespace epr
809 } // namespace modelgbp
810 #endif // GI_EPR_L2EP_HPP
bool isVmNameSet()
Check whether vmName has been set.
Definition: L2Ep.hpp:327
static boost::optional< boost::shared_ptr< modelgbp::epr::L2Ep > > resolve(const std::string &eprL2EpContext, const opflex::modb::MAC &eprL2EpMac)
Retrieve an instance of L2Ep from the default managed object store by constructing its URI from the p...
Definition: L2Ep.hpp:457
modelgbp::epr::L2Ep & setUuid(const std::string &newValue)
Set uuid to the specified value in the currently-active mutator.
Definition: L2Ep.hpp:305
modelgbp::epr::L2Ep & unsetUuid()
Unset uuid in the currently-active mutator.
Definition: L2Ep.hpp:317
boost::shared_ptr< modelgbp::epr::L3Net > addEprL3Net(const std::string &eprL3NetIp)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: L2Ep.hpp:613
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: L2Ep.hpp:765
boost::optional< const std::string & > getContext()
Get the value of context if it has been set.
Definition: L2Ep.hpp:56
modelgbp::epr::L2Ep & setVmName(const std::string &newValue)
Set vmName to the specified value in the currently-active mutator.
Definition: L2Ep.hpp:361
modelgbp::epr::L2Ep & unsetGroup()
Unset group in the currently-active mutator.
Definition: L2Ep.hpp:149
static boost::optional< boost::shared_ptr< modelgbp::epr::L2Ep > > resolve(opflex::ofcore::OFFramework &framework, const std::string &eprL2EpContext, const opflex::modb::MAC &eprL2EpMac)
Retrieve an instance of L2Ep from the managed object store by constructing its URI from the path elem...
Definition: L2Ep.hpp:432
boost::optional< const std::string & > getGroup()
Get the value of group if it has been set.
Definition: L2Ep.hpp:112
modelgbp::epr::L2Ep & unsetInterfaceName()
Unset interfaceName in the currently-active mutator.
Definition: L2Ep.hpp:205
modelgbp::epr::L2Ep & setContext(const std::string &newValue)
Set context to the specified value in the currently-active mutator.
Definition: L2Ep.hpp:81
boost::shared_ptr< modelgbp::gbpe::Attestation > addGbpeAttestation(const std::string &gbpeAttestationName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: L2Ep.hpp:493
const std::string & getInterfaceName(const std::string &defaultValue)
Get the value of interfaceName if set, otherwise the value of default passed in.
Definition: L2Ep.hpp:180
const std::string & getVmName(const std::string &defaultValue)
Get the value of vmName if set, otherwise the value of default passed in.
Definition: L2Ep.hpp:348
static boost::optional< boost::shared_ptr< modelgbp::epr::L2Ep > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of L2Ep from the managed object store.
Definition: L2Ep.hpp:390
modelgbp::epr::L2Ep & setMac(const opflex::modb::MAC &newValue)
Set mac to the specified value in the currently-active mutator.
Definition: L2Ep.hpp:249
boost::optional< const std::string & > getUuid()
Get the value of uuid if it has been set.
Definition: L2Ep.hpp:280
void resolveGbpeAttestation(std::vector< boost::shared_ptr< modelgbp::gbpe::Attestation > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbpe::Attestation.
Definition: L2Ep.hpp:518
boost::shared_ptr< modelgbp::span::LocalEpFromEpRTgt > addSpanLocalEpFromEpRTgt(const std::string &spanLocalEpFromEpRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: L2Ep.hpp:553
static boost::optional< boost::shared_ptr< modelgbp::epr::L3Net > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of L3Net from the managed object store.
Definition: L3Net.hpp:102
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: L2Ep.hpp:777
modelgbp::epr::L2Ep & unsetVmName()
Unset vmName in the currently-active mutator.
Definition: L2Ep.hpp:373
modelgbp::epr::L2Ep & setInterfaceName(const std::string &newValue)
Set interfaceName to the specified value in the currently-active mutator.
Definition: L2Ep.hpp:193
boost::optional< const opflex::modb::MAC & > getMac()
Get the value of mac if it has been set.
Definition: L2Ep.hpp:224
bool isMacSet()
Check whether mac has been set.
Definition: L2Ep.hpp:215
static boost::optional< boost::shared_ptr< modelgbp::gbpe::Attestation > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Attestation from the managed object store.
Definition: Attestation.hpp:210
boost::optional< boost::shared_ptr< modelgbp::epr::L3Net > > resolveEprL3Net(const std::string &eprL3NetIp)
Retrieve the child object with the specified naming properties.
Definition: L2Ep.hpp:595
modelgbp::epr::L2Ep & unsetMac()
Unset mac in the currently-active mutator.
Definition: L2Ep.hpp:261
bool isContextSet()
Check whether context has been set.
Definition: L2Ep.hpp:47
boost::optional< boost::shared_ptr< modelgbp::span::LocalEpFromEpRTgt > > resolveSpanLocalEpFromEpRTgt(const std::string &spanLocalEpFromEpRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: L2Ep.hpp:535
const std::string & getContext(const std::string &defaultValue)
Get the value of context if set, otherwise the value of default passed in.
Definition: L2Ep.hpp:68
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: L2Ep.hpp:791
modelgbp::epr::L2Ep & setGroup(const std::string &newValue)
Set group to the specified value in the currently-active mutator.
Definition: L2Ep.hpp:137
const std::string & getUuid(const std::string &defaultValue)
Get the value of uuid if set, otherwise the value of default passed in.
Definition: L2Ep.hpp:292
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: L2Ep.hpp:236
L2Ep(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of L2Ep.
Definition: L2Ep.hpp:801
boost::optional< const std::string & > getVmName()
Get the value of vmName if it has been set.
Definition: L2Ep.hpp:336
void resolveSpanLocalEpFromEpRTgt(std::vector< boost::shared_ptr< modelgbp::span::LocalEpFromEpRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::span::LocalEpFromEpRTgt.
Definition: L2Ep.hpp:578
static boost::optional< boost::shared_ptr< modelgbp::span::LocalEpFromEpRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalEpFromEpRTgt from the managed object store.
Definition: LocalEpFromEpRTgt.hpp:210
bool isGroupSet()
Check whether group has been set.
Definition: L2Ep.hpp:103
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: L2Ep.hpp:746
void resolveEprL3Net(std::vector< boost::shared_ptr< modelgbp::epr::L3Net > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::epr::L3Net.
Definition: L2Ep.hpp:638
boost::optional< boost::shared_ptr< modelgbp::gbpe::Attestation > > resolveGbpeAttestation(const std::string &gbpeAttestationName)
Retrieve the child object with the specified naming properties.
Definition: L2Ep.hpp:475
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for L2Ep.
Definition: L2Ep.hpp:41
modelgbp::epr::L2Ep & unsetContext()
Unset context in the currently-active mutator.
Definition: L2Ep.hpp:93
bool isUuidSet()
Check whether uuid has been set.
Definition: L2Ep.hpp:271
const std::string & getGroup(const std::string &defaultValue)
Get the value of group if set, otherwise the value of default passed in.
Definition: L2Ep.hpp:124
bool isInterfaceNameSet()
Check whether interfaceName has been set.
Definition: L2Ep.hpp:159
boost::optional< const std::string & > getInterfaceName()
Get the value of interfaceName if it has been set.
Definition: L2Ep.hpp:168
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
static boost::optional< boost::shared_ptr< modelgbp::epr::L2Ep > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of L2Ep from the managed object store using the default framework instance...
Definition: L2Ep.hpp:408
Definition: L2Ep.hpp:33