modelgbp Generated OpFlex Model  1.3.0
SrcGrp.hpp
1 
10 #pragma once
11 #ifndef GI_SPAN_SRCGRP_HPP
12 #define GI_SPAN_SRCGRP_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/SrcMember)
19  */
20 #include "modelgbp/span/SrcMember.hpp"
21 /*
22  * contains: item:mclass(span/DstMember)
23  */
24 #include "modelgbp/span/DstMember.hpp"
25 
26 namespace modelgbp {
27 namespace span {
28 
29 class SrcGrp
30  : public opflex::modb::mointernal::MO
31 {
32 public:
33 
37  static const opflex::modb::class_id_t CLASS_ID = 50;
38 
43  bool isLabelSet()
44  {
45  return getObjectInstance().isSet(1638403ul, opflex::modb::PropertyInfo::U64);
46  }
47 
52  boost::optional<uint32_t> getLabel()
53  {
54  if (isLabelSet())
55  return (uint32_t)getObjectInstance().getUInt64(1638403ul);
56  return boost::none;
57  }
58 
64  uint32_t getLabel(uint32_t defaultValue)
65  {
66  return getLabel().get_value_or(defaultValue);
67  }
68 
77  modelgbp::span::SrcGrp& setLabel(uint32_t newValue)
78  {
79  getTLMutator().modify(getClassId(), getURI())->setUInt64(1638403ul, newValue);
80  return *this;
81  }
82 
90  {
91  getTLMutator().modify(getClassId(), getURI())->unset(1638403ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
92  return *this;
93  }
94 
99  bool isNameSet()
100  {
101  return getObjectInstance().isSet(1638401ul, opflex::modb::PropertyInfo::STRING);
102  }
103 
108  boost::optional<const std::string&> getName()
109  {
110  if (isNameSet())
111  return getObjectInstance().getString(1638401ul);
112  return boost::none;
113  }
114 
120  const std::string& getName(const std::string& defaultValue)
121  {
122  return getName().get_value_or(defaultValue);
123  }
124 
133  modelgbp::span::SrcGrp& setName(const std::string& newValue)
134  {
135  getTLMutator().modify(getClassId(), getURI())->setString(1638401ul, newValue);
136  return *this;
137  }
138 
146  {
147  getTLMutator().modify(getClassId(), getURI())->unset(1638401ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
148  return *this;
149  }
150 
155  bool isStateSet()
156  {
157  return getObjectInstance().isSet(1638402ul, opflex::modb::PropertyInfo::ENUM8);
158  }
159 
164  boost::optional<const uint8_t> getState()
165  {
166  if (isStateSet())
167  return (const uint8_t)getObjectInstance().getUInt64(1638402ul);
168  return boost::none;
169  }
170 
176  const uint8_t getState(const uint8_t defaultValue)
177  {
178  return getState().get_value_or(defaultValue);
179  }
180 
189  modelgbp::span::SrcGrp& setState(const uint8_t newValue)
190  {
191  getTLMutator().modify(getClassId(), getURI())->setUInt64(1638402ul, newValue);
192  return *this;
193  }
194 
202  {
203  getTLMutator().modify(getClassId(), getURI())->unset(1638402ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
204  return *this;
205  }
206 
218  static boost::optional<boost::shared_ptr<modelgbp::span::SrcGrp> > resolve(
219  opflex::ofcore::OFFramework& framework,
220  const opflex::modb::URI& uri)
221  {
222  return opflex::modb::mointernal::MO::resolve<modelgbp::span::SrcGrp>(framework, CLASS_ID, uri);
223  }
224 
236  static boost::optional<boost::shared_ptr<modelgbp::span::SrcGrp> > resolve(
237  const opflex::modb::URI& uri)
238  {
239  return opflex::modb::mointernal::MO::resolve<modelgbp::span::SrcGrp>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
240  }
241 
260  static boost::optional<boost::shared_ptr<modelgbp::span::SrcGrp> > resolve(
261  opflex::ofcore::OFFramework& framework,
262  const std::string& platformConfigName,
263  const std::string& spanSrcGrpName)
264  {
265  return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanSrcGrp").addElement(spanSrcGrpName).build());
266  }
267 
285  static boost::optional<boost::shared_ptr<modelgbp::span::SrcGrp> > resolve(
286  const std::string& platformConfigName,
287  const std::string& spanSrcGrpName)
288  {
289  return resolve(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanSrcGrpName);
290  }
291 
303  boost::optional<boost::shared_ptr<modelgbp::span::SrcMember> > resolveSpanSrcMember(
304  const std::string& spanSrcMemberName)
305  {
306  return modelgbp::span::SrcMember::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("SpanSrcMember").addElement(spanSrcMemberName).build());
307  }
308 
321  boost::shared_ptr<modelgbp::span::SrcMember> addSpanSrcMember(
322  const std::string& spanSrcMemberName)
323  {
324  boost::shared_ptr<modelgbp::span::SrcMember> result = addChild<modelgbp::span::SrcMember>(
325  CLASS_ID, getURI(), 2149122108ul, 60,
326  opflex::modb::URIBuilder(getURI()).addElement("SpanSrcMember").addElement(spanSrcMemberName).build()
327  );
328  result->setName(spanSrcMemberName);
329  return result;
330  }
331 
346  void resolveSpanSrcMember(/* out */ std::vector<boost::shared_ptr<modelgbp::span::SrcMember> >& out)
347  {
348  opflex::modb::mointernal::MO::resolveChildren<modelgbp::span::SrcMember>(
349  getFramework(), CLASS_ID, getURI(), 2149122108ul, 60, out);
350  }
351 
363  boost::optional<boost::shared_ptr<modelgbp::span::DstMember> > resolveSpanDstMember(
364  const std::string& spanDstMemberName)
365  {
366  return modelgbp::span::DstMember::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("SpanDstMember").addElement(spanDstMemberName).build());
367  }
368 
381  boost::shared_ptr<modelgbp::span::DstMember> addSpanDstMember(
382  const std::string& spanDstMemberName)
383  {
384  boost::shared_ptr<modelgbp::span::DstMember> result = addChild<modelgbp::span::DstMember>(
385  CLASS_ID, getURI(), 2149122109ul, 61,
386  opflex::modb::URIBuilder(getURI()).addElement("SpanDstMember").addElement(spanDstMemberName).build()
387  );
388  result->setName(spanDstMemberName);
389  return result;
390  }
391 
406  void resolveSpanDstMember(/* out */ std::vector<boost::shared_ptr<modelgbp::span::DstMember> >& out)
407  {
408  opflex::modb::mointernal::MO::resolveChildren<modelgbp::span::DstMember>(
409  getFramework(), CLASS_ID, getURI(), 2149122109ul, 61, out);
410  }
411 
420  void remove()
421  {
422  getTLMutator().remove(CLASS_ID, getURI());
423  }
424 
435  static void remove(opflex::ofcore::OFFramework& framework,
436  const opflex::modb::URI& uri)
437  {
438  MO::remove(framework, CLASS_ID, uri);
439  }
440 
451  static void remove(const opflex::modb::URI& uri)
452  {
453  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
454  }
455 
472  static void remove(
473  opflex::ofcore::OFFramework& framework,
474  const std::string& platformConfigName,
475  const std::string& spanSrcGrpName)
476  {
477  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanSrcGrp").addElement(spanSrcGrpName).build());
478  }
479 
496  static void remove(
497  const std::string& platformConfigName,
498  const std::string& spanSrcGrpName)
499  {
500  remove(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanSrcGrpName);
501  }
502 
514  static void registerListener(
515  opflex::ofcore::OFFramework& framework,
516  opflex::modb::ObjectListener* listener)
517  {
518  opflex::modb::mointernal
519  ::MO::registerListener(framework, listener, CLASS_ID);
520  }
521 
533  static void registerListener(
534  opflex::modb::ObjectListener* listener)
535  {
536  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
537  }
538 
545  static void unregisterListener(
546  opflex::ofcore::OFFramework& framework,
547  opflex::modb::ObjectListener* listener)
548  {
549  opflex::modb::mointernal
550  ::MO::unregisterListener(framework, listener, CLASS_ID);
551  }
552 
559  static void unregisterListener(
560  opflex::modb::ObjectListener* listener)
561  {
562  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
563  }
564 
570  opflex::ofcore::OFFramework& framework,
571  const opflex::modb::URI& uri,
572  const boost::shared_ptr<const opflex::modb::mointernal::ObjectInstance>& oi)
573  : MO(framework, CLASS_ID, uri, oi) { }
574 }; // class SrcGrp
575 
576 } // namespace span
577 } // namespace modelgbp
578 #endif // GI_SPAN_SRCGRP_HPP
bool isLabelSet()
Check whether label has been set.
Definition: SrcGrp.hpp:43
static boost::optional< boost::shared_ptr< modelgbp::span::SrcGrp > > resolve(const std::string &platformConfigName, const std::string &spanSrcGrpName)
Retrieve an instance of SrcGrp from the default managed object store by constructing its URI from the...
Definition: SrcGrp.hpp:285
bool isStateSet()
Check whether state has been set.
Definition: SrcGrp.hpp:155
const uint8_t getState(const uint8_t defaultValue)
Get the value of state if set, otherwise the value of default passed in.
Definition: SrcGrp.hpp:176
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: SrcGrp.hpp:514
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for SrcGrp.
Definition: SrcGrp.hpp:37
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: SrcGrp.hpp:120
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: SrcGrp.hpp:559
boost::optional< uint32_t > getLabel()
Get the value of label if it has been set.
Definition: SrcGrp.hpp:52
modelgbp::span::SrcGrp & unsetName()
Unset name in the currently-active mutator.
Definition: SrcGrp.hpp:145
modelgbp::span::SrcGrp & unsetLabel()
Unset label in the currently-active mutator.
Definition: SrcGrp.hpp:89
boost::optional< boost::shared_ptr< modelgbp::span::DstMember > > resolveSpanDstMember(const std::string &spanDstMemberName)
Retrieve the child object with the specified naming properties.
Definition: SrcGrp.hpp:363
void resolveSpanDstMember(std::vector< boost::shared_ptr< modelgbp::span::DstMember > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::span::DstMember.
Definition: SrcGrp.hpp:406
static boost::optional< boost::shared_ptr< modelgbp::span::SrcGrp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SrcGrp from the managed object store.
Definition: SrcGrp.hpp:218
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: SrcGrp.hpp:108
boost::optional< const uint8_t > getState()
Get the value of state if it has been set.
Definition: SrcGrp.hpp:164
boost::shared_ptr< modelgbp::span::DstMember > addSpanDstMember(const std::string &spanDstMemberName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SrcGrp.hpp:381
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: SrcGrp.hpp:545
Definition: SrcGrp.hpp:29
static boost::optional< boost::shared_ptr< modelgbp::span::SrcMember > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SrcMember from the managed object store.
Definition: SrcMember.hpp:158
bool isNameSet()
Check whether name has been set.
Definition: SrcGrp.hpp:99
modelgbp::span::SrcGrp & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: SrcGrp.hpp:133
modelgbp::span::SrcGrp & setLabel(uint32_t newValue)
Set label to the specified value in the currently-active mutator.
Definition: SrcGrp.hpp:77
boost::shared_ptr< modelgbp::span::SrcMember > addSpanSrcMember(const std::string &spanSrcMemberName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SrcGrp.hpp:321
static boost::optional< boost::shared_ptr< modelgbp::span::DstMember > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of DstMember from the managed object store.
Definition: DstMember.hpp:106
modelgbp::span::SrcGrp & setState(const uint8_t newValue)
Set state to the specified value in the currently-active mutator.
Definition: SrcGrp.hpp:189
modelgbp::span::SrcGrp & unsetState()
Unset state in the currently-active mutator.
Definition: SrcGrp.hpp:201
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: SrcGrp.hpp:533
static boost::optional< boost::shared_ptr< modelgbp::span::SrcGrp > > resolve(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName, const std::string &spanSrcGrpName)
Retrieve an instance of SrcGrp from the managed object store by constructing its URI from the path el...
Definition: SrcGrp.hpp:260
uint32_t getLabel(uint32_t defaultValue)
Get the value of label if set, otherwise the value of default passed in.
Definition: SrcGrp.hpp:64
void resolveSpanSrcMember(std::vector< boost::shared_ptr< modelgbp::span::SrcMember > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::span::SrcMember.
Definition: SrcGrp.hpp:346
static boost::optional< boost::shared_ptr< modelgbp::span::SrcGrp > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of SrcGrp from the managed object store using the default framework instance...
Definition: SrcGrp.hpp:236
boost::optional< boost::shared_ptr< modelgbp::span::SrcMember > > resolveSpanSrcMember(const std::string &spanSrcMemberName)
Retrieve the child object with the specified naming properties.
Definition: SrcGrp.hpp:303
SrcGrp(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of SrcGrp.
Definition: SrcGrp.hpp:569