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 = 47;
37 return getObjectInstance().isSet(1540101ul, opflex::modb::PropertyInfo::U64);
47 return (
const uint8_t)getObjectInstance().getUInt64(1540101ul);
71 getTLMutator().modify(getClassId(), getURI())->setUInt64(1540101ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(1540101ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
93 return getObjectInstance().isSet(1540099ul, opflex::modb::PropertyInfo::U64);
103 return (uint16_t)getObjectInstance().getUInt64(1540099ul);
127 getTLMutator().modify(getClassId(), getURI())->setUInt64(1540099ul, newValue);
139 getTLMutator().modify(getClassId(), getURI())->unset(1540099ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
149 return getObjectInstance().isSet(1540098ul, opflex::modb::PropertyInfo::U64);
159 return (uint16_t)getObjectInstance().getUInt64(1540098ul);
183 getTLMutator().modify(getClassId(), getURI())->setUInt64(1540098ul, newValue);
195 getTLMutator().modify(getClassId(), getURI())->unset(1540098ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
205 return getObjectInstance().isSet(1540100ul, opflex::modb::PropertyInfo::ENUM8);
215 return (
const uint8_t)getObjectInstance().getUInt64(1540100ul);
224 const uint8_t
getMode(
const uint8_t defaultValue)
226 return getMode().get_value_or(defaultValue);
239 getTLMutator().modify(getClassId(), getURI())->setUInt64(1540100ul, newValue);
251 getTLMutator().modify(getClassId(), getURI())->unset(1540100ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
261 return getObjectInstance().isSet(1540097ul, opflex::modb::PropertyInfo::STRING);
271 return getObjectInstance().getString(1540097ul);
280 const std::string&
getName(
const std::string& defaultValue)
282 return getName().get_value_or(defaultValue);
295 getTLMutator().modify(getClassId(), getURI())->setString(1540097ul, newValue);
307 getTLMutator().modify(getClassId(), getURI())->unset(1540097ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
322 static boost::optional<boost::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<boost::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<boost::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<boost::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 boost::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 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
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
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
static boost::optional< boost::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 & setControlBits(const uint8_t newValue)
Set controlBits to the specified value in the currently-active mutator.
Definition: lacp/Config.hpp:69
static boost::optional< boost::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
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
Config(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const boost::shared_ptr< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Config.
Definition: lacp/Config.hpp:541
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
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
static boost::optional< boost::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
static boost::optional< boost::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