modelgbp Generated OpFlex Model  1.9.0
RemoteInventoryEp.hpp
1 
10 #pragma once
11 #ifndef GI_INV_REMOTEINVENTORYEP_HPP
12 #define GI_INV_REMOTEINVENTORYEP_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(inv/RemoteIp)
19  */
20 #include "modelgbp/inv/RemoteIp.hpp"
21 /*
22  * contains: item:mclass(inv/RemoteInventoryEpToGroupRSrc)
23  */
24 #include "modelgbp/inv/RemoteInventoryEpToGroupRSrc.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 = 142;
38 
43  bool isMacSet()
44  {
45  return getObjectInstance().isSet(4653058ul, opflex::modb::PropertyInfo::MAC);
46  }
47 
52  boost::optional<const opflex::modb::MAC&> getMac()
53  {
54  if (isMacSet())
55  return getObjectInstance().getMAC(4653058ul);
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::inv::RemoteInventoryEp& setMac(const opflex::modb::MAC& newValue)
78  {
79  getTLMutator().modify(getClassId(), getURI())->setMAC(4653058ul, newValue);
80  return *this;
81  }
82 
90  {
91  getTLMutator().modify(getClassId(), getURI())->unset(4653058ul, opflex::modb::PropertyInfo::MAC, opflex::modb::PropertyInfo::SCALAR);
92  return *this;
93  }
94 
100  {
101  return getObjectInstance().isSet(4653059ul, opflex::modb::PropertyInfo::STRING);
102  }
103 
108  boost::optional<const std::string&> getNextHopTunnel()
109  {
110  if (isNextHopTunnelSet())
111  return getObjectInstance().getString(4653059ul);
112  return boost::none;
113  }
114 
120  const std::string& getNextHopTunnel(const std::string& defaultValue)
121  {
122  return getNextHopTunnel().get_value_or(defaultValue);
123  }
124 
134  {
135  getTLMutator().modify(getClassId(), getURI())->setString(4653059ul, newValue);
136  return *this;
137  }
138 
146  {
147  getTLMutator().modify(getClassId(), getURI())->unset(4653059ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
148  return *this;
149  }
150 
155  bool isUuidSet()
156  {
157  return getObjectInstance().isSet(4653057ul, opflex::modb::PropertyInfo::STRING);
158  }
159 
164  boost::optional<const std::string&> getUuid()
165  {
166  if (isUuidSet())
167  return getObjectInstance().getString(4653057ul);
168  return boost::none;
169  }
170 
176  const std::string& getUuid(const std::string& defaultValue)
177  {
178  return getUuid().get_value_or(defaultValue);
179  }
180 
189  modelgbp::inv::RemoteInventoryEp& setUuid(const std::string& newValue)
190  {
191  getTLMutator().modify(getClassId(), getURI())->setString(4653057ul, newValue);
192  return *this;
193  }
194 
202  {
203  getTLMutator().modify(getClassId(), getURI())->unset(4653057ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
204  return *this;
205  }
206 
218  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteInventoryEp> > resolve(
219  opflex::ofcore::OFFramework& framework,
220  const opflex::modb::URI& uri)
221  {
222  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::RemoteInventoryEp>(framework, CLASS_ID, uri);
223  }
224 
236  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteInventoryEp> > resolve(
237  const opflex::modb::URI& uri)
238  {
239  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::RemoteInventoryEp>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
240  }
241 
258  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteInventoryEp> > resolve(
259  opflex::ofcore::OFFramework& framework,
260  const std::string& invRemoteInventoryEpUuid)
261  {
262  return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvRemoteEndpointInventory").addElement("InvRemoteInventoryEp").addElement(invRemoteInventoryEpUuid).build());
263  }
264 
280  static boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteInventoryEp> > resolve(
281  const std::string& invRemoteInventoryEpUuid)
282  {
283  return resolve(opflex::ofcore::OFFramework::defaultInstance(),invRemoteInventoryEpUuid);
284  }
285 
297  boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteIp> > resolveInvRemoteIp(
298  const std::string& invRemoteIpIp)
299  {
300  return modelgbp::inv::RemoteIp::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("InvRemoteIp").addElement(invRemoteIpIp).build());
301  }
302 
315  OF_SHARED_PTR<modelgbp::inv::RemoteIp> addInvRemoteIp(
316  const std::string& invRemoteIpIp)
317  {
318  OF_SHARED_PTR<modelgbp::inv::RemoteIp> result = addChild<modelgbp::inv::RemoteIp>(
319  CLASS_ID, getURI(), 2152136831ul, 127,
320  opflex::modb::URIBuilder(getURI()).addElement("InvRemoteIp").addElement(invRemoteIpIp).build()
321  );
322  result->setIp(invRemoteIpIp);
323  return result;
324  }
325 
340  void resolveInvRemoteIp(/* out */ std::vector<OF_SHARED_PTR<modelgbp::inv::RemoteIp> >& out)
341  {
342  opflex::modb::mointernal::MO::resolveChildren<modelgbp::inv::RemoteIp>(
343  getFramework(), CLASS_ID, getURI(), 2152136831ul, 127, out);
344  }
345 
355  boost::optional<OF_SHARED_PTR<modelgbp::inv::RemoteInventoryEpToGroupRSrc> > resolveInvRemoteInventoryEpToGroupRSrc(
356  )
357  {
358  return modelgbp::inv::RemoteInventoryEpToGroupRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("InvRemoteInventoryEpToGroupRSrc").build());
359  }
360 
371  OF_SHARED_PTR<modelgbp::inv::RemoteInventoryEpToGroupRSrc> addInvRemoteInventoryEpToGroupRSrc(
372  )
373  {
374  OF_SHARED_PTR<modelgbp::inv::RemoteInventoryEpToGroupRSrc> result = addChild<modelgbp::inv::RemoteInventoryEpToGroupRSrc>(
375  CLASS_ID, getURI(), 2152136847ul, 143,
376  opflex::modb::URIBuilder(getURI()).addElement("InvRemoteInventoryEpToGroupRSrc").build()
377  );
378  return result;
379  }
380 
389  void remove()
390  {
391  getTLMutator().remove(CLASS_ID, getURI());
392  }
393 
404  static void remove(opflex::ofcore::OFFramework& framework,
405  const opflex::modb::URI& uri)
406  {
407  MO::remove(framework, CLASS_ID, uri);
408  }
409 
420  static void remove(const opflex::modb::URI& uri)
421  {
422  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
423  }
424 
439  static void remove(
440  opflex::ofcore::OFFramework& framework,
441  const std::string& invRemoteInventoryEpUuid)
442  {
443  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvRemoteEndpointInventory").addElement("InvRemoteInventoryEp").addElement(invRemoteInventoryEpUuid).build());
444  }
445 
460  static void remove(
461  const std::string& invRemoteInventoryEpUuid)
462  {
463  remove(opflex::ofcore::OFFramework::defaultInstance(),invRemoteInventoryEpUuid);
464  }
465 
477  static void registerListener(
478  opflex::ofcore::OFFramework& framework,
479  opflex::modb::ObjectListener* listener)
480  {
481  opflex::modb::mointernal
482  ::MO::registerListener(framework, listener, CLASS_ID);
483  }
484 
496  static void registerListener(
497  opflex::modb::ObjectListener* listener)
498  {
499  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
500  }
501 
508  static void unregisterListener(
509  opflex::ofcore::OFFramework& framework,
510  opflex::modb::ObjectListener* listener)
511  {
512  opflex::modb::mointernal
513  ::MO::unregisterListener(framework, listener, CLASS_ID);
514  }
515 
522  static void unregisterListener(
523  opflex::modb::ObjectListener* listener)
524  {
525  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
526  }
527 
533  opflex::ofcore::OFFramework& framework,
534  const opflex::modb::URI& uri,
535  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
536  : MO(framework, CLASS_ID, uri, oi) { }
537 }; // class RemoteInventoryEp
538 
539 } // namespace inv
540 } // namespace modelgbp
541 #endif // GI_INV_REMOTEINVENTORYEP_HPP
bool isMacSet()
Check whether mac has been set.
Definition: RemoteInventoryEp.hpp:43
boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteInventoryEpToGroupRSrc > > resolveInvRemoteInventoryEpToGroupRSrc()
Retrieve the child object with the specified naming properties.
Definition: RemoteInventoryEp.hpp:355
const std::string & getNextHopTunnel(const std::string &defaultValue)
Get the value of nextHopTunnel if set, otherwise the value of default passed in.
Definition: RemoteInventoryEp.hpp:120
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteInventoryEp > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invRemoteInventoryEpUuid)
Retrieve an instance of RemoteInventoryEp from the managed object store by constructing its URI from ...
Definition: RemoteInventoryEp.hpp:258
OF_SHARED_PTR< modelgbp::inv::RemoteInventoryEpToGroupRSrc > addInvRemoteInventoryEpToGroupRSrc()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: RemoteInventoryEp.hpp:371
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RemoteIp from the managed object store.
Definition: RemoteIp.hpp:98
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: RemoteInventoryEp.hpp:496
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: RemoteInventoryEp.hpp:508
modelgbp::inv::RemoteInventoryEp & setUuid(const std::string &newValue)
Set uuid to the specified value in the currently-active mutator.
Definition: RemoteInventoryEp.hpp:189
modelgbp::inv::RemoteInventoryEp & setNextHopTunnel(const std::string &newValue)
Set nextHopTunnel to the specified value in the currently-active mutator.
Definition: RemoteInventoryEp.hpp:133
modelgbp::inv::RemoteInventoryEp & unsetMac()
Unset mac in the currently-active mutator.
Definition: RemoteInventoryEp.hpp:89
boost::optional< const std::string & > getNextHopTunnel()
Get the value of nextHopTunnel if it has been set.
Definition: RemoteInventoryEp.hpp:108
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for RemoteInventoryEp.
Definition: RemoteInventoryEp.hpp:37
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: RemoteInventoryEp.hpp:522
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: RemoteInventoryEp.hpp:64
void resolveInvRemoteIp(std::vector< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::inv::RemoteIp.
Definition: RemoteInventoryEp.hpp:340
bool isNextHopTunnelSet()
Check whether nextHopTunnel has been set.
Definition: RemoteInventoryEp.hpp:99
modelgbp::inv::RemoteInventoryEp & setMac(const opflex::modb::MAC &newValue)
Set mac to the specified value in the currently-active mutator.
Definition: RemoteInventoryEp.hpp:77
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteInventoryEpToGroupRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RemoteInventoryEpToGroupRSrc from the managed object store.
Definition: RemoteInventoryEpToGroupRSrc.hpp:257
boost::optional< const opflex::modb::MAC & > getMac()
Get the value of mac if it has been set.
Definition: RemoteInventoryEp.hpp:52
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: RemoteInventoryEp.hpp:477
bool isUuidSet()
Check whether uuid has been set.
Definition: RemoteInventoryEp.hpp:155
RemoteInventoryEp(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of RemoteInventoryEp.
Definition: RemoteInventoryEp.hpp:532
OF_SHARED_PTR< modelgbp::inv::RemoteIp > addInvRemoteIp(const std::string &invRemoteIpIp)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: RemoteInventoryEp.hpp:315
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteInventoryEp > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of RemoteInventoryEp from the managed object store.
Definition: RemoteInventoryEp.hpp:218
Definition: RemoteInventoryEp.hpp:29
modelgbp::inv::RemoteInventoryEp & unsetUuid()
Unset uuid in the currently-active mutator.
Definition: RemoteInventoryEp.hpp:201
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteInventoryEp > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of RemoteInventoryEp from the managed object store using the default framework i...
Definition: RemoteInventoryEp.hpp:236
const std::string & getUuid(const std::string &defaultValue)
Get the value of uuid if set, otherwise the value of default passed in.
Definition: RemoteInventoryEp.hpp:176
boost::optional< const std::string & > getUuid()
Get the value of uuid if it has been set.
Definition: RemoteInventoryEp.hpp:164
boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteIp > > resolveInvRemoteIp(const std::string &invRemoteIpIp)
Retrieve the child object with the specified naming properties.
Definition: RemoteInventoryEp.hpp:297
static boost::optional< OF_SHARED_PTR< modelgbp::inv::RemoteInventoryEp > > resolve(const std::string &invRemoteInventoryEpUuid)
Retrieve an instance of RemoteInventoryEp from the default managed object store by constructing its U...
Definition: RemoteInventoryEp.hpp:280
modelgbp::inv::RemoteInventoryEp & unsetNextHopTunnel()
Unset nextHopTunnel in the currently-active mutator.
Definition: RemoteInventoryEp.hpp:145