11 #ifndef GI_INV_STATICROUTE_HPP
12 #define GI_INV_STATICROUTE_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
22 :
public opflex::modb::mointernal::MO
29 static const opflex::modb::class_id_t
CLASS_ID = 133;
37 return getObjectInstance().isSet(4358145ul, opflex::modb::PropertyInfo::STRING);
44 boost::optional<const std::string&>
getDest()
47 return getObjectInstance().getString(4358145ul);
56 const std::string&
getDest(
const std::string& defaultValue)
58 return getDest().get_value_or(defaultValue);
71 getTLMutator().modify(getClassId(), getURI())->setString(4358145ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(4358145ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
93 return getObjectInstance().isSet(4358147ul, opflex::modb::PropertyInfo::STRING);
103 return getObjectInstance().getString(4358147ul);
112 const std::string&
getNextHop(
const std::string& defaultValue)
114 return getNextHop().get_value_or(defaultValue);
127 getTLMutator().modify(getClassId(), getURI())->setString(4358147ul, newValue);
139 getTLMutator().modify(getClassId(), getURI())->unset(4358147ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
149 return getObjectInstance().isSet(4358146ul, opflex::modb::PropertyInfo::U64);
159 return (
const uint8_t)getObjectInstance().getUInt64(4358146ul);
183 getTLMutator().modify(getClassId(), getURI())->setUInt64(4358146ul, newValue);
195 getTLMutator().modify(getClassId(), getURI())->unset(4358146ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
210 static boost::optional<OF_SHARED_PTR<modelgbp::inv::StaticRoute> >
resolve(
211 opflex::ofcore::OFFramework& framework,
212 const opflex::modb::URI& uri)
214 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::StaticRoute>(framework,
CLASS_ID, uri);
228 static boost::optional<OF_SHARED_PTR<modelgbp::inv::StaticRoute> >
resolve(
229 const opflex::modb::URI& uri)
231 return opflex::modb::mointernal::MO::resolve<modelgbp::inv::StaticRoute>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
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)
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());
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)
299 return resolve(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invStaticRouteDest,invStaticRoutePrefixLen,invStaticRouteNextHop);
312 getTLMutator().remove(
CLASS_ID, getURI());
325 static void remove(opflex::ofcore::OFFramework& framework,
326 const opflex::modb::URI& uri)
328 MO::remove(framework,
CLASS_ID, uri);
341 static void remove(
const opflex::modb::URI& uri)
343 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
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)
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());
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)
408 remove(opflex::ofcore::OFFramework::defaultInstance(),invLocalEndpointInventoryName,invLocalInventoryEpUuid,invStaticRouteDest,invStaticRoutePrefixLen,invStaticRouteNextHop);
423 opflex::ofcore::OFFramework& framework,
424 opflex::modb::ObjectListener* listener)
426 opflex::modb::mointernal
427 ::MO::registerListener(framework, listener,
CLASS_ID);
442 opflex::modb::ObjectListener* listener)
454 opflex::ofcore::OFFramework& framework,
455 opflex::modb::ObjectListener* listener)
457 opflex::modb::mointernal
458 ::MO::unregisterListener(framework, listener,
CLASS_ID);
468 opflex::modb::ObjectListener* listener)
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) { }
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