11 #ifndef GI_LACP_CONFIG_HPP
12 #define GI_LACP_CONFIG_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 = 64;
37 return getObjectInstance().isSet(2097157ul, opflex::modb::PropertyInfo::U64);
47 return (
const uint8_t)getObjectInstance().getUInt64(2097157ul);
71 getTLMutator().modify(getClassId(), getURI())->setUInt64(2097157ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(2097157ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
93 return getObjectInstance().isSet(2097155ul, opflex::modb::PropertyInfo::U64);
103 return (uint16_t)getObjectInstance().getUInt64(2097155ul);
127 getTLMutator().modify(getClassId(), getURI())->setUInt64(2097155ul, newValue);
139 getTLMutator().modify(getClassId(), getURI())->unset(2097155ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
149 return getObjectInstance().isSet(2097154ul, opflex::modb::PropertyInfo::U64);
159 return (uint16_t)getObjectInstance().getUInt64(2097154ul);
183 getTLMutator().modify(getClassId(), getURI())->setUInt64(2097154ul, newValue);
195 getTLMutator().modify(getClassId(), getURI())->unset(2097154ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
205 return getObjectInstance().isSet(2097156ul, opflex::modb::PropertyInfo::ENUM8);
215 return (
const uint8_t)getObjectInstance().getUInt64(2097156ul);
224 const uint8_t
getMode(
const uint8_t defaultValue)
226 return getMode().get_value_or(defaultValue);
239 getTLMutator().modify(getClassId(), getURI())->setUInt64(2097156ul, newValue);
251 getTLMutator().modify(getClassId(), getURI())->unset(2097156ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
261 return getObjectInstance().isSet(2097153ul, opflex::modb::PropertyInfo::STRING);
271 return getObjectInstance().getString(2097153ul);
280 const std::string&
getName(
const std::string& defaultValue)
282 return getName().get_value_or(defaultValue);
295 getTLMutator().modify(getClassId(), getURI())->setString(2097153ul, newValue);
307 getTLMutator().modify(getClassId(), getURI())->unset(2097153ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
322 static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> >
resolve(
323 opflex::ofcore::OFFramework& framework,
324 const opflex::modb::URI& uri)
326 return opflex::modb::mointernal::MO::resolve<modelgbp::lacp::Config>(framework,
CLASS_ID, uri);
340 static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> >
resolve(
341 const opflex::modb::URI& uri)
343 return opflex::modb::mointernal::MO::resolve<modelgbp::lacp::Config>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
362 static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> >
resolve(
363 opflex::ofcore::OFFramework& framework,
364 const std::string& platformConfigName)
366 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PlatformConfig").addElement(platformConfigName).addElement(
"LacpConfig").build());
384 static boost::optional<OF_SHARED_PTR<modelgbp::lacp::Config> >
resolve(
385 const std::string& platformConfigName)
387 return resolve(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
400 getTLMutator().remove(
CLASS_ID, getURI());
413 static void remove(opflex::ofcore::OFFramework& framework,
414 const opflex::modb::URI& uri)
416 MO::remove(framework,
CLASS_ID, uri);
429 static void remove(
const opflex::modb::URI& uri)
431 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
449 opflex::ofcore::OFFramework& framework,
450 const std::string& platformConfigName)
452 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PlatformConfig").addElement(platformConfigName).addElement(
"LacpConfig").build());
470 const std::string& platformConfigName)
472 remove(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName);
487 opflex::ofcore::OFFramework& framework,
488 opflex::modb::ObjectListener* listener)
490 opflex::modb::mointernal
491 ::MO::registerListener(framework, listener,
CLASS_ID);
506 opflex::modb::ObjectListener* listener)
518 opflex::ofcore::OFFramework& framework,
519 opflex::modb::ObjectListener* listener)
521 opflex::modb::mointernal
522 ::MO::unregisterListener(framework, listener,
CLASS_ID);
532 opflex::modb::ObjectListener* listener)
542 opflex::ofcore::OFFramework& framework,
543 const opflex::modb::URI& uri,
544 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
545 : MO(framework,
CLASS_ID, uri, oi) { }
550 #endif // GI_LACP_CONFIG_HPP
boost::optional< const uint8_t > getMode()
Get the value of mode if it has been set.
Definition: lacp/Config.hpp:212
Definition: lacp/Config.hpp:21
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store using the default framework instance...
Definition: lacp/Config.hpp:340
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: lacp/Config.hpp:517
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Config.
Definition: lacp/Config.hpp:29
bool isControlBitsSet()
Check whether controlBits has been set.
Definition: lacp/Config.hpp:35
bool isMaxLinksSet()
Check whether maxLinks has been set.
Definition: lacp/Config.hpp:91
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName)
Retrieve an instance of Config from the managed object store by constructing its URI from the path el...
Definition: lacp/Config.hpp:362
Config(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Config.
Definition: lacp/Config.hpp:541
modelgbp::lacp::Config & unsetName()
Unset name in the currently-active mutator.
Definition: lacp/Config.hpp:305
uint16_t getMinLinks(uint16_t defaultValue)
Get the value of minLinks if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:168
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:280
uint16_t getMaxLinks(uint16_t defaultValue)
Get the value of maxLinks if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:112
bool isNameSet()
Check whether name has been set.
Definition: lacp/Config.hpp:259
modelgbp::lacp::Config & setMinLinks(uint16_t newValue)
Set minLinks to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:181
bool isMinLinksSet()
Check whether minLinks has been set.
Definition: lacp/Config.hpp:147
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: lacp/Config.hpp:486
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: lacp/Config.hpp:505
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Config from the managed object store.
Definition: lacp/Config.hpp:322
boost::optional< uint16_t > getMaxLinks()
Get the value of maxLinks if it has been set.
Definition: lacp/Config.hpp:100
modelgbp::lacp::Config & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:293
modelgbp::lacp::Config & unsetControlBits()
Unset controlBits in the currently-active mutator.
Definition: lacp/Config.hpp:81
modelgbp::lacp::Config & unsetMinLinks()
Unset minLinks in the currently-active mutator.
Definition: lacp/Config.hpp:193
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: lacp/Config.hpp:268
bool isModeSet()
Check whether mode has been set.
Definition: lacp/Config.hpp:203
modelgbp::lacp::Config & setControlBits(const uint8_t newValue)
Set controlBits to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:69
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: lacp/Config.hpp:531
modelgbp::lacp::Config & setMaxLinks(uint16_t newValue)
Set maxLinks to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:125
const uint8_t getMode(const uint8_t defaultValue)
Get the value of mode if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:224
modelgbp::lacp::Config & unsetMode()
Unset mode in the currently-active mutator.
Definition: lacp/Config.hpp:249
boost::optional< const uint8_t > getControlBits()
Get the value of controlBits if it has been set.
Definition: lacp/Config.hpp:44
modelgbp::lacp::Config & unsetMaxLinks()
Unset maxLinks in the currently-active mutator.
Definition: lacp/Config.hpp:137
const uint8_t getControlBits(const uint8_t defaultValue)
Get the value of controlBits if set, otherwise the value of default passed in.
Definition: lacp/Config.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::lacp::Config > > resolve(const std::string &platformConfigName)
Retrieve an instance of Config from the default managed object store by constructing its URI from the...
Definition: lacp/Config.hpp:384
modelgbp::lacp::Config & setMode(const uint8_t newValue)
Set mode to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:237
boost::optional< uint16_t > getMinLinks()
Get the value of minLinks if it has been set.
Definition: lacp/Config.hpp:156