modelgbp Generated OpFlex Model  1.7.0
Ip.hpp
1 
10 #pragma once
11 #ifndef GI_INV_IP_HPP
12 #define GI_INV_IP_HPP
13 
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
17 
18 namespace modelgbp {
19 namespace inv {
20 
21 class Ip
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 123;
30 
35  bool isIpSet()
36  {
37  return getObjectInstance().isSet(4030465ul, opflex::modb::PropertyInfo::STRING);
38  }
39 
44  boost::optional<const std::string&> getIp()
45  {
46  if (isIpSet())
47  return getObjectInstance().getString(4030465ul);
48  return boost::none;
49  }
50 
56  const std::string& getIp(const std::string& defaultValue)
57  {
58  return getIp().get_value_or(defaultValue);
59  }
60 
69  modelgbp::inv::Ip& setIp(const std::string& newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setString(4030465ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(4030465ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
91  bool isMacSet()
92  {
93  return getObjectInstance().isSet(4030467ul, opflex::modb::PropertyInfo::MAC);
94  }
95 
100  boost::optional<const opflex::modb::MAC&> getMac()
101  {
102  if (isMacSet())
103  return getObjectInstance().getMAC(4030467ul);
104  return boost::none;
105  }
106 
112  const opflex::modb::MAC& getMac(const opflex::modb::MAC& defaultValue)
113  {
114  return getMac().get_value_or(defaultValue);
115  }
116 
125  modelgbp::inv::Ip& setMac(const opflex::modb::MAC& newValue)
126  {
127  getTLMutator().modify(getClassId(), getURI())->setMAC(4030467ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(4030467ul, opflex::modb::PropertyInfo::MAC, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
147  bool isTypeSet()
148  {
149  return getObjectInstance().isSet(4030466ul, opflex::modb::PropertyInfo::STRING);
150  }
151 
156  boost::optional<const std::string&> getType()
157  {
158  if (isTypeSet())
159  return getObjectInstance().getString(4030466ul);
160  return boost::none;
161  }
162 
168  const std::string& getType(const std::string& defaultValue)
169  {
170  return getType().get_value_or(defaultValue);
171  }
172 
181  modelgbp::inv::Ip& setType(const std::string& newValue)
182  {
183  getTLMutator().modify(getClassId(), getURI())->setString(4030466ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(4030466ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
210  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Ip> > resolve(
211  opflex::ofcore::OFFramework& framework,
212  const opflex::modb::URI& uri)
213  {
214  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Ip>(framework, CLASS_ID, uri);
215  }
216 
228  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Ip> > resolve(
229  const opflex::modb::URI& uri)
230  {
231  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::Ip>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
232  }
233 
256  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Ip> > resolve(
257  opflex::ofcore::OFFramework& framework,
258  const std::string& invLocalEndpointInventoryName,
259  const std::string& invLocalInventoryEpUuid,
260  const std::string& invIpIp,
261  const std::string& invIpType)
262  {
263  return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvIp").addElement(invIpIp).addElement(invIpType).build());
264  }
265 
287  static boost::optional<OF_SHARED_PTR<modelgbp::inv::Ip> > resolve(
288  const std::string& invLocalEndpointInventoryName,
289  const std::string& invLocalInventoryEpUuid,
290  const std::string& invIpIp,
291  const std::string& invIpType)
292  {
293  return resolve(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invIpIp,invIpType);
294  }
295 
304  void remove()
305  {
306  getTLMutator().remove(CLASS_ID, getURI());
307  }
308 
319  static void remove(opflex::ofcore::OFFramework& framework,
320  const opflex::modb::URI& uri)
321  {
322  MO::remove(framework, CLASS_ID, uri);
323  }
324 
335  static void remove(const opflex::modb::URI& uri)
336  {
337  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
338  }
339 
360  static void remove(
361  opflex::ofcore::OFFramework& framework,
362  const std::string& invLocalEndpointInventoryName,
363  const std::string& invLocalInventoryEpUuid,
364  const std::string& invIpIp,
365  const std::string& invIpType)
366  {
367  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvIp").addElement(invIpIp).addElement(invIpType).build());
368  }
369 
390  static void remove(
391  const std::string& invLocalEndpointInventoryName,
392  const std::string& invLocalInventoryEpUuid,
393  const std::string& invIpIp,
394  const std::string& invIpType)
395  {
396  remove(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invIpIp,invIpType);
397  }
398 
410  static void registerListener(
411  opflex::ofcore::OFFramework& framework,
412  opflex::modb::ObjectListener* listener)
413  {
414  opflex::modb::mointernal
415  ::MO::registerListener(framework, listener, CLASS_ID);
416  }
417 
429  static void registerListener(
430  opflex::modb::ObjectListener* listener)
431  {
432  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
433  }
434 
441  static void unregisterListener(
442  opflex::ofcore::OFFramework& framework,
443  opflex::modb::ObjectListener* listener)
444  {
445  opflex::modb::mointernal
446  ::MO::unregisterListener(framework, listener, CLASS_ID);
447  }
448 
455  static void unregisterListener(
456  opflex::modb::ObjectListener* listener)
457  {
458  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
459  }
460 
465  Ip(
466  opflex::ofcore::OFFramework& framework,
467  const opflex::modb::URI& uri,
468  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
469  : MO(framework, CLASS_ID, uri, oi) { }
470 }; // class Ip
471 
472 } // namespace inv
473 } // namespace modelgbp
474 #endif // GI_INV_IP_HPP
const std::string & getType(const std::string &defaultValue)
Get the value of type if set, otherwise the value of default passed in.
Definition: Ip.hpp:168
boost::optional< const std::string & > getType()
Get the value of type if it has been set.
Definition: Ip.hpp:156
bool isMacSet()
Check whether mac has been set.
Definition: Ip.hpp:91
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: Ip.hpp:410
boost::optional< const opflex::modb::MAC & > getMac()
Get the value of mac if it has been set.
Definition: Ip.hpp:100
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Ip > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invIpIp, const std::string &invIpType)
Retrieve an instance of Ip from the managed object store by constructing its URI from the path elemen...
Definition: Ip.hpp:256
bool isTypeSet()
Check whether type has been set.
Definition: Ip.hpp:147
Definition: Ip.hpp:21
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: Ip.hpp:112
modelgbp::inv::Ip & unsetType()
Unset type in the currently-active mutator.
Definition: Ip.hpp:193
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: Ip.hpp:441
const std::string & getIp(const std::string &defaultValue)
Get the value of ip if set, otherwise the value of default passed in.
Definition: Ip.hpp:56
modelgbp::inv::Ip & unsetIp()
Unset ip in the currently-active mutator.
Definition: Ip.hpp:81
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: Ip.hpp:455
bool isIpSet()
Check whether ip has been set.
Definition: Ip.hpp:35
Ip(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Ip.
Definition: Ip.hpp:465
modelgbp::inv::Ip & setIp(const std::string &newValue)
Set ip to the specified value in the currently-active mutator.
Definition: Ip.hpp:69
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: Ip.hpp:429
modelgbp::inv::Ip & unsetMac()
Unset mac in the currently-active mutator.
Definition: Ip.hpp:137
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Ip > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Ip from the managed object store using the default framework instance...
Definition: Ip.hpp:228
modelgbp::inv::Ip & setType(const std::string &newValue)
Set type to the specified value in the currently-active mutator.
Definition: Ip.hpp:181
boost::optional< const std::string & > getIp()
Get the value of ip if it has been set.
Definition: Ip.hpp:44
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Ip > > resolve(const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invIpIp, const std::string &invIpType)
Retrieve an instance of Ip from the default managed object store by constructing its URI from the pat...
Definition: Ip.hpp:287
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Ip.
Definition: Ip.hpp:29
static boost::optional< OF_SHARED_PTR< modelgbp::inv::Ip > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Ip from the managed object store.
Definition: Ip.hpp:210
modelgbp::inv::Ip & setMac(const opflex::modb::MAC &newValue)
Set mac to the specified value in the currently-active mutator.
Definition: Ip.hpp:125