modelgbp Generated OpFlex Model  1.7.0
LocalEndpointInventory.hpp
1 
10 #pragma once
11 #ifndef GI_INV_LOCALENDPOINTINVENTORY_HPP
12 #define GI_INV_LOCALENDPOINTINVENTORY_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(domain/ConfigFromEndpointInventoryRTgt)
19  */
20 #include "modelgbp/domain/ConfigFromEndpointInventoryRTgt.hpp"
21 /*
22  * contains: item:mclass(inv/LocalInventoryEp)
23  */
24 #include "modelgbp/inv/LocalInventoryEp.hpp"
25 
26 namespace modelgbp {
27 namespace inv {
28 
30  : public opflex::modb::mointernal::MO
31 {
32 public:
33 
37  static const opflex::modb::class_id_t CLASS_ID = 114;
38 
43  bool isNameSet()
44  {
45  return getObjectInstance().isSet(3735553ul, opflex::modb::PropertyInfo::STRING);
46  }
47 
52  boost::optional<const std::string&> getName()
53  {
54  if (isNameSet())
55  return getObjectInstance().getString(3735553ul);
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::inv::LocalEndpointInventory& setName(const std::string& newValue)
78  {
79  getTLMutator().modify(getClassId(), getURI())->setString(3735553ul, newValue);
80  return *this;
81  }
82 
90  {
91  getTLMutator().modify(getClassId(), getURI())->unset(3735553ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
92  return *this;
93  }
94 
106  static boost::optional<OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> > resolve(
107  opflex::ofcore::OFFramework& framework,
108  const opflex::modb::URI& uri)
109  {
110  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::LocalEndpointInventory>(framework, CLASS_ID, uri);
111  }
112 
124  static boost::optional<OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> > resolve(
125  const opflex::modb::URI& uri)
126  {
127  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::LocalEndpointInventory>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
128  }
129 
146  static boost::optional<OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> > resolve(
147  opflex::ofcore::OFFramework& framework,
148  const std::string& invLocalEndpointInventoryName)
149  {
150  return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).build());
151  }
152 
168  static boost::optional<OF_SHARED_PTR<modelgbp::inv::LocalEndpointInventory> > resolve(
169  const std::string& invLocalEndpointInventoryName)
170  {
171  return resolve(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName);
172  }
173 
185  boost::optional<OF_SHARED_PTR<modelgbp::domain::ConfigFromEndpointInventoryRTgt> > resolveDomainConfigFromEndpointInventoryRTgt(
186  const std::string& domainConfigFromEndpointInventoryRTgtSource)
187  {
188  return modelgbp::domain::ConfigFromEndpointInventoryRTgt::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("DomainConfigFromEndpointInventoryRTgt").addElement(domainConfigFromEndpointInventoryRTgtSource).build());
189  }
190 
203  OF_SHARED_PTR<modelgbp::domain::ConfigFromEndpointInventoryRTgt> addDomainConfigFromEndpointInventoryRTgt(
204  const std::string& domainConfigFromEndpointInventoryRTgtSource)
205  {
206  OF_SHARED_PTR<modelgbp::domain::ConfigFromEndpointInventoryRTgt> result = addChild<modelgbp::domain::ConfigFromEndpointInventoryRTgt>(
207  CLASS_ID, getURI(), 2151219261ul, 61,
208  opflex::modb::URIBuilder(getURI()).addElement("DomainConfigFromEndpointInventoryRTgt").addElement(domainConfigFromEndpointInventoryRTgtSource).build()
209  );
210  result->setSource(domainConfigFromEndpointInventoryRTgtSource);
211  return result;
212  }
213 
228  void resolveDomainConfigFromEndpointInventoryRTgt(/* out */ std::vector<OF_SHARED_PTR<modelgbp::domain::ConfigFromEndpointInventoryRTgt> >& out)
229  {
230  opflex::modb::mointernal::MO::resolveChildren<modelgbp::domain::ConfigFromEndpointInventoryRTgt>(
231  getFramework(), CLASS_ID, getURI(), 2151219261ul, 61, out);
232  }
233 
245  boost::optional<OF_SHARED_PTR<modelgbp::inv::LocalInventoryEp> > resolveInvLocalInventoryEp(
246  const std::string& invLocalInventoryEpUuid)
247  {
248  return modelgbp::inv::LocalInventoryEp::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).build());
249  }
250 
263  OF_SHARED_PTR<modelgbp::inv::LocalInventoryEp> addInvLocalInventoryEp(
264  const std::string& invLocalInventoryEpUuid)
265  {
266  OF_SHARED_PTR<modelgbp::inv::LocalInventoryEp> result = addChild<modelgbp::inv::LocalInventoryEp>(
267  CLASS_ID, getURI(), 2151219316ul, 116,
268  opflex::modb::URIBuilder(getURI()).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).build()
269  );
270  result->setUuid(invLocalInventoryEpUuid);
271  return result;
272  }
273 
288  void resolveInvLocalInventoryEp(/* out */ std::vector<OF_SHARED_PTR<modelgbp::inv::LocalInventoryEp> >& out)
289  {
290  opflex::modb::mointernal::MO::resolveChildren<modelgbp::inv::LocalInventoryEp>(
291  getFramework(), CLASS_ID, getURI(), 2151219316ul, 116, out);
292  }
293 
302  void remove()
303  {
304  getTLMutator().remove(CLASS_ID, getURI());
305  }
306 
317  static void remove(opflex::ofcore::OFFramework& framework,
318  const opflex::modb::URI& uri)
319  {
320  MO::remove(framework, CLASS_ID, uri);
321  }
322 
333  static void remove(const opflex::modb::URI& uri)
334  {
335  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
336  }
337 
352  static void remove(
353  opflex::ofcore::OFFramework& framework,
354  const std::string& invLocalEndpointInventoryName)
355  {
356  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).build());
357  }
358 
373  static void remove(
374  const std::string& invLocalEndpointInventoryName)
375  {
376  remove(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName);
377  }
378 
390  static void registerListener(
391  opflex::ofcore::OFFramework& framework,
392  opflex::modb::ObjectListener* listener)
393  {
394  opflex::modb::mointernal
395  ::MO::registerListener(framework, listener, CLASS_ID);
396  }
397 
409  static void registerListener(
410  opflex::modb::ObjectListener* listener)
411  {
412  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
413  }
414 
421  static void unregisterListener(
422  opflex::ofcore::OFFramework& framework,
423  opflex::modb::ObjectListener* listener)
424  {
425  opflex::modb::mointernal
426  ::MO::unregisterListener(framework, listener, CLASS_ID);
427  }
428 
435  static void unregisterListener(
436  opflex::modb::ObjectListener* listener)
437  {
438  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
439  }
440 
446  opflex::ofcore::OFFramework& framework,
447  const opflex::modb::URI& uri,
448  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
449  : MO(framework, CLASS_ID, uri, oi) { }
450 }; // class LocalEndpointInventory
451 
452 } // namespace inv
453 } // namespace modelgbp
454 #endif // GI_INV_LOCALENDPOINTINVENTORY_HPP
void resolveDomainConfigFromEndpointInventoryRTgt(std::vector< OF_SHARED_PTR< modelgbp::domain::ConfigFromEndpointInventoryRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::domain::ConfigFromEndpointInvent...
Definition: LocalEndpointInventory.hpp:228
void resolveInvLocalInventoryEp(std::vector< OF_SHARED_PTR< modelgbp::inv::LocalInventoryEp > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::inv::LocalInventoryEp.
Definition: LocalEndpointInventory.hpp:288
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for LocalEndpointInventory.
Definition: LocalEndpointInventory.hpp:37
boost::optional< OF_SHARED_PTR< modelgbp::domain::ConfigFromEndpointInventoryRTgt > > resolveDomainConfigFromEndpointInventoryRTgt(const std::string &domainConfigFromEndpointInventoryRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: LocalEndpointInventory.hpp:185
modelgbp::inv::LocalEndpointInventory & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: LocalEndpointInventory.hpp:77
LocalEndpointInventory(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of LocalEndpointInventory.
Definition: LocalEndpointInventory.hpp:445
OF_SHARED_PTR< modelgbp::domain::ConfigFromEndpointInventoryRTgt > addDomainConfigFromEndpointInventoryRTgt(const std::string &domainConfigFromEndpointInventoryRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: LocalEndpointInventory.hpp:203
static boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName)
Retrieve an instance of LocalEndpointInventory from the managed object store by constructing its URI ...
Definition: LocalEndpointInventory.hpp:146
static boost::optional< OF_SHARED_PTR< modelgbp::domain::ConfigFromEndpointInventoryRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of ConfigFromEndpointInventoryRTgt from the managed object store.
Definition: ConfigFromEndpointInventoryRTgt.hpp:210
bool isNameSet()
Check whether name has been set.
Definition: LocalEndpointInventory.hpp:43
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: LocalEndpointInventory.hpp:390
boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalInventoryEp > > resolveInvLocalInventoryEp(const std::string &invLocalInventoryEpUuid)
Retrieve the child object with the specified naming properties.
Definition: LocalEndpointInventory.hpp:245
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: LocalEndpointInventory.hpp:64
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: LocalEndpointInventory.hpp:52
OF_SHARED_PTR< modelgbp::inv::LocalInventoryEp > addInvLocalInventoryEp(const std::string &invLocalInventoryEpUuid)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: LocalEndpointInventory.hpp:263
Definition: LocalEndpointInventory.hpp:29
static boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalInventoryEp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalInventoryEp from the managed object store.
Definition: LocalInventoryEp.hpp:410
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: LocalEndpointInventory.hpp:421
static boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of LocalEndpointInventory from the managed object store.
Definition: LocalEndpointInventory.hpp:106
static boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of LocalEndpointInventory from the managed object store using the default framew...
Definition: LocalEndpointInventory.hpp:124
static boost::optional< OF_SHARED_PTR< modelgbp::inv::LocalEndpointInventory > > resolve(const std::string &invLocalEndpointInventoryName)
Retrieve an instance of LocalEndpointInventory from the default managed object store by constructing ...
Definition: LocalEndpointInventory.hpp:168
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: LocalEndpointInventory.hpp:409
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: LocalEndpointInventory.hpp:435
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
modelgbp::inv::LocalEndpointInventory & unsetName()
Unset name in the currently-active mutator.
Definition: LocalEndpointInventory.hpp:89