modelgbp Generated OpFlex Model  1.7.0
StaticRoute.hpp
1 
10 #pragma once
11 #ifndef GI_INV_STATICROUTE_HPP
12 #define GI_INV_STATICROUTE_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 
22  : public opflex::modb::mointernal::MO
23 {
24 public:
25 
29  static const opflex::modb::class_id_t CLASS_ID = 133;
30 
35  bool isDestSet()
36  {
37  return getObjectInstance().isSet(4358145ul, opflex::modb::PropertyInfo::STRING);
38  }
39 
44  boost::optional<const std::string&> getDest()
45  {
46  if (isDestSet())
47  return getObjectInstance().getString(4358145ul);
48  return boost::none;
49  }
50 
56  const std::string& getDest(const std::string& defaultValue)
57  {
58  return getDest().get_value_or(defaultValue);
59  }
60 
69  modelgbp::inv::StaticRoute& setDest(const std::string& newValue)
70  {
71  getTLMutator().modify(getClassId(), getURI())->setString(4358145ul, newValue);
72  return *this;
73  }
74 
82  {
83  getTLMutator().modify(getClassId(), getURI())->unset(4358145ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
84  return *this;
85  }
86 
91  bool isNextHopSet()
92  {
93  return getObjectInstance().isSet(4358147ul, opflex::modb::PropertyInfo::STRING);
94  }
95 
100  boost::optional<const std::string&> getNextHop()
101  {
102  if (isNextHopSet())
103  return getObjectInstance().getString(4358147ul);
104  return boost::none;
105  }
106 
112  const std::string& getNextHop(const std::string& defaultValue)
113  {
114  return getNextHop().get_value_or(defaultValue);
115  }
116 
125  modelgbp::inv::StaticRoute& setNextHop(const std::string& newValue)
126  {
127  getTLMutator().modify(getClassId(), getURI())->setString(4358147ul, newValue);
128  return *this;
129  }
130 
138  {
139  getTLMutator().modify(getClassId(), getURI())->unset(4358147ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
140  return *this;
141  }
142 
148  {
149  return getObjectInstance().isSet(4358146ul, opflex::modb::PropertyInfo::U64);
150  }
151 
156  boost::optional<const uint8_t> getPrefixLen()
157  {
158  if (isPrefixLenSet())
159  return (const uint8_t)getObjectInstance().getUInt64(4358146ul);
160  return boost::none;
161  }
162 
168  const uint8_t getPrefixLen(const uint8_t defaultValue)
169  {
170  return getPrefixLen().get_value_or(defaultValue);
171  }
172 
181  modelgbp::inv::StaticRoute& setPrefixLen(const uint8_t newValue)
182  {
183  getTLMutator().modify(getClassId(), getURI())->setUInt64(4358146ul, newValue);
184  return *this;
185  }
186 
194  {
195  getTLMutator().modify(getClassId(), getURI())->unset(4358146ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
196  return *this;
197  }
198 
210  static boost::optional<OF_SHARED_PTR<modelgbp::inv::StaticRoute> > resolve(
211  opflex::ofcore::OFFramework& framework,
212  const opflex::modb::URI& uri)
213  {
214  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::StaticRoute>(framework, CLASS_ID, uri);
215  }
216 
228  static boost::optional<OF_SHARED_PTR<modelgbp::inv::StaticRoute> > resolve(
229  const opflex::modb::URI& uri)
230  {
231  return opflex::modb::mointernal::MO::resolve<modelgbp::inv::StaticRoute>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
232  }
233 
258  static boost::optional<OF_SHARED_PTR<modelgbp::inv::StaticRoute> > resolve(
259  opflex::ofcore::OFFramework& framework,
260  const std::string& invLocalEndpointInventoryName,
261  const std::string& invLocalInventoryEpUuid,
262  const std::string& invStaticRouteDest,
263  const uint8_t invStaticRoutePrefixLen,
264  const std::string& invStaticRouteNextHop)
265  {
266  return resolve(framework,opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvDHCPv4Config").addElement("InvStaticRoute").addElement(invStaticRouteDest).addElement(invStaticRoutePrefixLen).addElement(invStaticRouteNextHop).build());
267  }
268 
292  static boost::optional<OF_SHARED_PTR<modelgbp::inv::StaticRoute> > resolve(
293  const std::string& invLocalEndpointInventoryName,
294  const std::string& invLocalInventoryEpUuid,
295  const std::string& invStaticRouteDest,
296  const uint8_t invStaticRoutePrefixLen,
297  const std::string& invStaticRouteNextHop)
298  {
299  return resolve(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invStaticRouteDest,invStaticRoutePrefixLen,invStaticRouteNextHop);
300  }
301 
310  void remove()
311  {
312  getTLMutator().remove(CLASS_ID, getURI());
313  }
314 
325  static void remove(opflex::ofcore::OFFramework& framework,
326  const opflex::modb::URI& uri)
327  {
328  MO::remove(framework, CLASS_ID, uri);
329  }
330 
341  static void remove(const opflex::modb::URI& uri)
342  {
343  remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
344  }
345 
368  static void remove(
369  opflex::ofcore::OFFramework& framework,
370  const std::string& invLocalEndpointInventoryName,
371  const std::string& invLocalInventoryEpUuid,
372  const std::string& invStaticRouteDest,
373  const uint8_t invStaticRoutePrefixLen,
374  const std::string& invStaticRouteNextHop)
375  {
376  MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("InvUniverse").addElement("InvLocalEndpointInventory").addElement(invLocalEndpointInventoryName).addElement("InvLocalInventoryEp").addElement(invLocalInventoryEpUuid).addElement("InvDHCPv4Config").addElement("InvStaticRoute").addElement(invStaticRouteDest).addElement(invStaticRoutePrefixLen).addElement(invStaticRouteNextHop).build());
377  }
378 
401  static void remove(
402  const std::string& invLocalEndpointInventoryName,
403  const std::string& invLocalInventoryEpUuid,
404  const std::string& invStaticRouteDest,
405  const uint8_t invStaticRoutePrefixLen,
406  const std::string& invStaticRouteNextHop)
407  {
408  remove(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invStaticRouteDest,invStaticRoutePrefixLen,invStaticRouteNextHop);
409  }
410 
422  static void registerListener(
423  opflex::ofcore::OFFramework& framework,
424  opflex::modb::ObjectListener* listener)
425  {
426  opflex::modb::mointernal
427  ::MO::registerListener(framework, listener, CLASS_ID);
428  }
429 
441  static void registerListener(
442  opflex::modb::ObjectListener* listener)
443  {
444  registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
445  }
446 
453  static void unregisterListener(
454  opflex::ofcore::OFFramework& framework,
455  opflex::modb::ObjectListener* listener)
456  {
457  opflex::modb::mointernal
458  ::MO::unregisterListener(framework, listener, CLASS_ID);
459  }
460 
467  static void unregisterListener(
468  opflex::modb::ObjectListener* listener)
469  {
470  unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
471  }
472 
478  opflex::ofcore::OFFramework& framework,
479  const opflex::modb::URI& uri,
480  const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
481  : MO(framework, CLASS_ID, uri, oi) { }
482 }; // class StaticRoute
483 
484 } // namespace inv
485 } // namespace modelgbp
486 #endif // GI_INV_STATICROUTE_HPP
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: StaticRoute.hpp:441
boost::optional< const std::string & > getDest()
Get the value of dest if it has been set.
Definition: StaticRoute.hpp:44
boost::optional< const uint8_t > getPrefixLen()
Get the value of prefixLen if it has been set.
Definition: StaticRoute.hpp:156
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: StaticRoute.hpp:453
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: StaticRoute.hpp:467
StaticRoute(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of StaticRoute.
Definition: StaticRoute.hpp:477
const uint8_t getPrefixLen(const uint8_t defaultValue)
Get the value of prefixLen if set, otherwise the value of default passed in.
Definition: StaticRoute.hpp:168
modelgbp::inv::StaticRoute & unsetNextHop()
Unset nextHop in the currently-active mutator.
Definition: StaticRoute.hpp:137
modelgbp::inv::StaticRoute & unsetPrefixLen()
Unset prefixLen in the currently-active mutator.
Definition: StaticRoute.hpp:193
const std::string & getDest(const std::string &defaultValue)
Get the value of dest if set, otherwise the value of default passed in.
Definition: StaticRoute.hpp:56
bool isDestSet()
Check whether dest has been set.
Definition: StaticRoute.hpp:35
bool isPrefixLenSet()
Check whether prefixLen has been set.
Definition: StaticRoute.hpp:147
modelgbp::inv::StaticRoute & unsetDest()
Unset dest in the currently-active mutator.
Definition: StaticRoute.hpp:81
bool isNextHopSet()
Check whether nextHop has been set.
Definition: StaticRoute.hpp:91
modelgbp::inv::StaticRoute & setDest(const std::string &newValue)
Set dest to the specified value in the currently-active mutator.
Definition: StaticRoute.hpp:69
static boost::optional< OF_SHARED_PTR< modelgbp::inv::StaticRoute > > resolve(const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invStaticRouteDest, const uint8_t invStaticRoutePrefixLen, const std::string &invStaticRouteNextHop)
Retrieve an instance of StaticRoute from the default managed object store by constructing its URI fro...
Definition: StaticRoute.hpp:292
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: StaticRoute.hpp:422
static boost::optional< OF_SHARED_PTR< modelgbp::inv::StaticRoute > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of StaticRoute from the managed object store using the default framework instanc...
Definition: StaticRoute.hpp:228
boost::optional< const std::string & > getNextHop()
Get the value of nextHop if it has been set.
Definition: StaticRoute.hpp:100
static boost::optional< OF_SHARED_PTR< modelgbp::inv::StaticRoute > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of StaticRoute from the managed object store.
Definition: StaticRoute.hpp:210
modelgbp::inv::StaticRoute & setNextHop(const std::string &newValue)
Set nextHop to the specified value in the currently-active mutator.
Definition: StaticRoute.hpp:125
Definition: StaticRoute.hpp:21
static boost::optional< OF_SHARED_PTR< modelgbp::inv::StaticRoute > > resolve(opflex::ofcore::OFFramework &framework, const std::string &invLocalEndpointInventoryName, const std::string &invLocalInventoryEpUuid, const std::string &invStaticRouteDest, const uint8_t invStaticRoutePrefixLen, const std::string &invStaticRouteNextHop)
Retrieve an instance of StaticRoute from the managed object store by constructing its URI from the pa...
Definition: StaticRoute.hpp:258
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for StaticRoute.
Definition: StaticRoute.hpp:29
modelgbp::inv::StaticRoute & setPrefixLen(const uint8_t newValue)
Set prefixLen to the specified value in the currently-active mutator.
Definition: StaticRoute.hpp:181
const std::string & getNextHop(const std::string &defaultValue)
Get the value of nextHop if set, otherwise the value of default passed in.
Definition: StaticRoute.hpp:112
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12