modelgbp Generated OpFlex Model  1.7.0
LocalEp.hpp
1 
10 #pragma once
11 #ifndef GI_SPAN_LOCALEP_HPP
12 #define GI_SPAN_LOCALEP_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(span/LocalEpToEpRSrc)
19  */
20 #include "modelgbp/span/LocalEpToEpRSrc.hpp"
21 /*
22  * contains: item:mclass(span/MemberFromRefRTgt)
23  */
24 #include "modelgbp/span/MemberFromRefRTgt.hpp"
25 
26 namespace modelgbp {
27 namespace span {
28 
29 class LocalEp
30  : public opflex::modb::mointernal::MO
31 {
32 public:
33 
37  static const opflex::modb::class_id_t CLASS_ID = 69;
38 
43  bool isNameSet()
44  {
45  return getObjectInstance().isSet(2260993ul, opflex::modb::PropertyInfo::STRING);
46  }
47 
52  boost::optional<const std::string&> getName()
53  {
54  if (isNameSet())
55  return getObjectInstance().getString(2260993ul);
56  return boost::none;
57  }
58 
64  const std::string& getName(const std::string& defaultValue)
65  {
66  return getName().get_value_or(defaultValue);
67  }
68 
77  modelgbp::span::LocalEp& setName(const std::string& newValue)
78  {
79  getTLMutator().modify(getClassId(), getURI())->setString(2260993ul, newValue);
80  return *this;
81  }
82 
90  {
91  getTLMutator().modify(getClassId(), getURI())->unset(2260993ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
92  return *this;
93  }
94 
99  bool isNicSet()
100  {
101  return getObjectInstance().isSet(2260994ul, opflex::modb::PropertyInfo::STRING);
102  }
103 
108  boost::optional<const std::string&> getNic()
109  {
110  if (isNicSet())
111  return getObjectInstance().getString(2260994ul);
112  return boost::none;
113  }
114 
120  const std::string& getNic(const std::string& defaultValue)
121  {
122  return getNic().get_value_or(defaultValue);
123  }
124 
133  modelgbp::span::LocalEp& setNic(const std::string& newValue)
134  {
135  getTLMutator().modify(getClassId(), getURI())->setString(2260994ul, newValue);
136  return *this;
137  }
138 
146  {
147  getTLMutator().modify(getClassId(), getURI())->unset(2260994ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
148  return *this;
149  }
150 
162  static boost::optional<OF_SHARED_PTR<modelgbp::span::LocalEp> > resolve(
163  opflex::ofcore::OFFramework& framework,
164  const opflex::modb::URI& uri)
165  {
166  return opflex::modb::mointernal::MO::resolve<modelgbp::span::LocalEp>(framework, CLASS_ID, uri);
167  }
168 
180  static boost::optional<OF_SHARED_PTR<modelgbp::span::LocalEp> > resolve(
181  const opflex::modb::URI& uri)
182  {
183  return opflex::modb::mointernal::MO::resolve<modelgbp::span::LocalEp>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
184  }
185 
204  static boost::optional<OF_SHARED_PTR<modelgbp::span::LocalEp> > resolve(
205  opflex::ofcore::OFFramework& framework,
206  const std::string& platformConfigName,
207  const std::string& spanLocalEpName)
208  {
209  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanLocalEp").addElement(spanLocalEpName).build());
210  }
211 
229  static boost::optional<OF_SHARED_PTR<modelgbp::span::LocalEp> > resolve(
230  const std::string& platformConfigName,
231  const std::string& spanLocalEpName)
232  {
233  return resolve(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanLocalEpName);
234  }
235 
245  boost::optional<OF_SHARED_PTR<modelgbp::span::LocalEpToEpRSrc> > resolveSpanLocalEpToEpRSrc(
246  )
247  {
248  return modelgbp::span::LocalEpToEpRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("SpanLocalEpToEpRSrc").build());
249  }
250 
261  OF_SHARED_PTR<modelgbp::span::LocalEpToEpRSrc> addSpanLocalEpToEpRSrc(
262  )
263  {
264  OF_SHARED_PTR<modelgbp::span::LocalEpToEpRSrc> result = addChild<modelgbp::span::LocalEpToEpRSrc>(
265  CLASS_ID, getURI(), 2149744710ul, 70,
266  opflex::modb::URIBuilder(getURI()).addElement("SpanLocalEpToEpRSrc").build()
267  );
268  return result;
269  }
270 
282  boost::optional<OF_SHARED_PTR<modelgbp::span::MemberFromRefRTgt> > resolveSpanMemberFromRefRTgt(
283  const std::string& spanMemberFromRefRTgtSource)
284  {
285  return modelgbp::span::MemberFromRefRTgt::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("SpanMemberFromRefRTgt").addElement(spanMemberFromRefRTgtSource).build());
286  }
287 
300  OF_SHARED_PTR<modelgbp::span::MemberFromRefRTgt> addSpanMemberFromRefRTgt(
301  const std::string& spanMemberFromRefRTgtSource)
302  {
303  OF_SHARED_PTR<modelgbp::span::MemberFromRefRTgt> result = addChild<modelgbp::span::MemberFromRefRTgt>(
304  CLASS_ID, getURI(), 2149744715ul, 75,
305  opflex::modb::URIBuilder(getURI()).addElement("SpanMemberFromRefRTgt").addElement(spanMemberFromRefRTgtSource).build()
306  );
307  result->setSource(spanMemberFromRefRTgtSource);
308  return result;
309  }
310 
325  void resolveSpanMemberFromRefRTgt(/* out */ std::vector<OF_SHARED_PTR<modelgbp::span::MemberFromRefRTgt> >& out)
326  {
327  opflex::modb::mointernal::MO::resolveChildren<modelgbp::span::MemberFromRefRTgt>(
328  getFramework(), CLASS_ID, getURI(), 2149744715ul, 75, out);
329  }
330 
339  void remove()
340  {
341  getTLMutator().remove(CLASS_ID, getURI());
342  }
343 
354  static void remove(opflex::ofcore::OFFramework& framework,
355  const opflex::modb::URI& uri)
356  {
357  MO::remove(framework, CLASS_ID, uri);
358  }
359 
370  static void remove(const opflex::modb::URI& uri)
371  {
372  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
373  }
374 
391  static void remove(
392  opflex::ofcore::OFFramework& framework,
393  const std::string& platformConfigName,
394  const std::string& spanLocalEpName)
395  {
396  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanLocalEp").addElement(spanLocalEpName).build());
397  }
398 
415  static void remove(
416  const std::string& platformConfigName,
417  const std::string& spanLocalEpName)
418  {
419  remove(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanLocalEpName);
420  }
421 
433  static void registerListener(
434  opflex::ofcore::OFFramework& framework,
435  opflex::modb::ObjectListener* listener)
436  {
437  opflex::modb::mointernal
438  ::MO::registerListener(framework, listener, CLASS_ID);
439  }
440 
452  static void registerListener(
453  opflex::modb::ObjectListener* listener)
454  {
455  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
456  }
457 
464  static void unregisterListener(
465  opflex::ofcore::OFFramework& framework,
466  opflex::modb::ObjectListener* listener)
467  {
468  opflex::modb::mointernal
469  ::MO::unregisterListener(framework, listener, CLASS_ID);
470  }
471 
478  static void unregisterListener(
479  opflex::modb::ObjectListener* listener)
480  {
481  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
482  }
483 
489  opflex::ofcore::OFFramework& framework,
490  const opflex::modb::URI& uri,
491  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
492  : MO(framework, CLASS_ID, uri, oi) { }
493 }; // class LocalEp
494 
495 } // namespace span
496 } // namespace modelgbp
497 #endif // GI_SPAN_LOCALEP_HPP
modelgbp::span::LocalEp & unsetName()
Unset name in the currently-active mutator.
Definition: LocalEp.hpp:89
bool isNicSet()
Check whether nic has been set.
Definition: LocalEp.hpp:99
OF_SHARED_PTR< modelgbp::span::LocalEpToEpRSrc > addSpanLocalEpToEpRSrc()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: LocalEp.hpp:261
LocalEp(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of LocalEp.
Definition: LocalEp.hpp:488
const std::string & getNic(const std::string &defaultValue)
Get the value of nic if set, otherwise the value of default passed in.
Definition: LocalEp.hpp:120
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: LocalEp.hpp:452
void resolveSpanMemberFromRefRTgt(std::vector< OF_SHARED_PTR< modelgbp::span::MemberFromRefRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::span::MemberFromRefRTgt.
Definition: LocalEp.hpp:325
Definition: LocalEp.hpp:29
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for LocalEp.
Definition: LocalEp.hpp:37
boost::optional< const std::string & > getNic()
Get the value of nic if it has been set.
Definition: LocalEp.hpp:108
OF_SHARED_PTR< modelgbp::span::MemberFromRefRTgt > addSpanMemberFromRefRTgt(const std::string &spanMemberFromRefRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: LocalEp.hpp:300
boost::optional< OF_SHARED_PTR< modelgbp::span::LocalEpToEpRSrc > > resolveSpanLocalEpToEpRSrc()
Retrieve the child object with the specified naming properties.
Definition: LocalEp.hpp:245
bool isNameSet()
Check whether name has been set.
Definition: LocalEp.hpp:43
modelgbp::span::LocalEp & unsetNic()
Unset nic in the currently-active mutator.
Definition: LocalEp.hpp:145
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: LocalEp.hpp:464
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: LocalEp.hpp:433
static boost::optional< OF_SHARED_PTR< modelgbp::span::LocalEp > > resolve(const std::string &platformConfigName, const std::string &spanLocalEpName)
Retrieve an instance of LocalEp from the default managed object store by constructing its URI from th...
Definition: LocalEp.hpp:229
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: LocalEp.hpp:478
boost::optional< OF_SHARED_PTR< modelgbp::span::MemberFromRefRTgt > > resolveSpanMemberFromRefRTgt(const std::string &spanMemberFromRefRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: LocalEp.hpp:282
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: LocalEp.hpp:52
static boost::optional< OF_SHARED_PTR< modelgbp::span::LocalEp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalEp from the managed object store.
Definition: LocalEp.hpp:162
modelgbp::span::LocalEp & setNic(const std::string &newValue)
Set nic to the specified value in the currently-active mutator.
Definition: LocalEp.hpp:133
static boost::optional< OF_SHARED_PTR< modelgbp::span::LocalEp > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of LocalEp from the managed object store using the default framework instance...
Definition: LocalEp.hpp:180
static boost::optional< OF_SHARED_PTR< modelgbp::span::LocalEp > > resolve(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName, const std::string &spanLocalEpName)
Retrieve an instance of LocalEp from the managed object store by constructing its URI from the path e...
Definition: LocalEp.hpp:204
static boost::optional< OF_SHARED_PTR< modelgbp::span::MemberFromRefRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of MemberFromRefRTgt from the managed object store.
Definition: MemberFromRefRTgt.hpp:210
static boost::optional< OF_SHARED_PTR< modelgbp::span::LocalEpToEpRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalEpToEpRSrc from the managed object store.
Definition: LocalEpToEpRSrc.hpp:297
modelgbp::span::LocalEp & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: LocalEp.hpp:77
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: LocalEp.hpp:64
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12