11 #ifndef GI_DFW_EPCOUNTER_HPP
12 #define GI_DFW_EPCOUNTER_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 = 55;
37 return getObjectInstance().isSet(1802242ul, opflex::modb::PropertyInfo::U64);
47 return getObjectInstance().getUInt64(1802242ul);
58 return getRxDrop().get_value_or(defaultValue);
71 getTLMutator().modify(getClassId(), getURI())->setUInt64(1802242ul, newValue);
83 getTLMutator().modify(getClassId(), getURI())->unset(1802242ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
93 return getObjectInstance().isSet(1802243ul, opflex::modb::PropertyInfo::U64);
103 return getObjectInstance().getUInt64(1802243ul);
114 return getTxDrop().get_value_or(defaultValue);
127 getTLMutator().modify(getClassId(), getURI())->setUInt64(1802243ul, newValue);
139 getTLMutator().modify(getClassId(), getURI())->unset(1802243ul, opflex::modb::PropertyInfo::U64, opflex::modb::PropertyInfo::SCALAR);
149 return getObjectInstance().isSet(1802241ul, opflex::modb::PropertyInfo::STRING);
159 return getObjectInstance().getString(1802241ul);
168 const std::string&
getUuid(
const std::string& defaultValue)
170 return getUuid().get_value_or(defaultValue);
183 getTLMutator().modify(getClassId(), getURI())->setString(1802241ul, newValue);
195 getTLMutator().modify(getClassId(), getURI())->unset(1802241ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
210 static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> >
resolve(
211 opflex::ofcore::OFFramework& framework,
212 const opflex::modb::URI& uri)
214 return opflex::modb::mointernal::MO::resolve<modelgbp::dfw::EpCounter>(framework,
CLASS_ID, uri);
228 static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> >
resolve(
229 const opflex::modb::URI& uri)
231 return opflex::modb::mointernal::MO::resolve<modelgbp::dfw::EpCounter>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
250 static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> >
resolve(
251 opflex::ofcore::OFFramework& framework,
252 const std::string& dfwEpCounterUuid)
254 return resolve(framework,opflex::modb::URIBuilder().addElement(
"ObserverEpStatUniverse").addElement(
"DfwEpCounter").addElement(dfwEpCounterUuid).build());
272 static boost::optional<OF_SHARED_PTR<modelgbp::dfw::EpCounter> >
resolve(
273 const std::string& dfwEpCounterUuid)
275 return resolve(opflex::ofcore::OFFramework::defaultInstance(),dfwEpCounterUuid);
288 getTLMutator().remove(
CLASS_ID, getURI());
301 static void remove(opflex::ofcore::OFFramework& framework,
302 const opflex::modb::URI& uri)
304 MO::remove(framework,
CLASS_ID, uri);
317 static void remove(
const opflex::modb::URI& uri)
319 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
337 opflex::ofcore::OFFramework& framework,
338 const std::string& dfwEpCounterUuid)
340 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"ObserverEpStatUniverse").addElement(
"DfwEpCounter").addElement(dfwEpCounterUuid).build());
358 const std::string& dfwEpCounterUuid)
360 remove(opflex::ofcore::OFFramework::defaultInstance(),dfwEpCounterUuid);
375 opflex::ofcore::OFFramework& framework,
376 opflex::modb::ObjectListener* listener)
378 opflex::modb::mointernal
379 ::MO::registerListener(framework, listener,
CLASS_ID);
394 opflex::modb::ObjectListener* listener)
406 opflex::ofcore::OFFramework& framework,
407 opflex::modb::ObjectListener* listener)
409 opflex::modb::mointernal
410 ::MO::unregisterListener(framework, listener,
CLASS_ID);
420 opflex::modb::ObjectListener* listener)
430 opflex::ofcore::OFFramework& framework,
431 const opflex::modb::URI& uri,
432 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
433 : MO(framework,
CLASS_ID, uri, oi) { }
438 #endif // GI_DFW_EPCOUNTER_HPP
Definition: dfw/EpCounter.hpp:21
modelgbp::dfw::EpCounter & setRxDrop(uint64_t newValue)
Set rxDrop to the specified value in the currently-active mutator.
Definition: dfw/EpCounter.hpp:69
bool isUuidSet()
Check whether uuid has been set.
Definition: dfw/EpCounter.hpp:147
const std::string & getUuid(const std::string &defaultValue)
Get the value of uuid if set, otherwise the value of default passed in.
Definition: dfw/EpCounter.hpp:168
bool isTxDropSet()
Check whether txDrop has been set.
Definition: dfw/EpCounter.hpp:91
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for EpCounter.
Definition: dfw/EpCounter.hpp:29
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: dfw/EpCounter.hpp:405
boost::optional< uint64_t > getTxDrop()
Get the value of txDrop if it has been set.
Definition: dfw/EpCounter.hpp:100
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of EpCounter from the managed object store using the default framework instance...
Definition: dfw/EpCounter.hpp:228
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(const std::string &dfwEpCounterUuid)
Retrieve an instance of EpCounter from the default managed object store by constructing its URI from ...
Definition: dfw/EpCounter.hpp:272
modelgbp::dfw::EpCounter & setTxDrop(uint64_t newValue)
Set txDrop to the specified value in the currently-active mutator.
Definition: dfw/EpCounter.hpp:125
modelgbp::dfw::EpCounter & unsetUuid()
Unset uuid in the currently-active mutator.
Definition: dfw/EpCounter.hpp:193
boost::optional< const std::string & > getUuid()
Get the value of uuid if it has been set.
Definition: dfw/EpCounter.hpp:156
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(opflex::ofcore::OFFramework &framework, const std::string &dfwEpCounterUuid)
Retrieve an instance of EpCounter from the managed object store by constructing its URI from the path...
Definition: dfw/EpCounter.hpp:250
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: dfw/EpCounter.hpp:374
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: dfw/EpCounter.hpp:393
boost::optional< uint64_t > getRxDrop()
Get the value of rxDrop if it has been set.
Definition: dfw/EpCounter.hpp:44
bool isRxDropSet()
Check whether rxDrop has been set.
Definition: dfw/EpCounter.hpp:35
modelgbp::dfw::EpCounter & unsetRxDrop()
Unset rxDrop in the currently-active mutator.
Definition: dfw/EpCounter.hpp:81
EpCounter(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of EpCounter.
Definition: dfw/EpCounter.hpp:429
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: dfw/EpCounter.hpp:419
uint64_t getTxDrop(uint64_t defaultValue)
Get the value of txDrop if set, otherwise the value of default passed in.
Definition: dfw/EpCounter.hpp:112
modelgbp::dfw::EpCounter & unsetTxDrop()
Unset txDrop in the currently-active mutator.
Definition: dfw/EpCounter.hpp:137
uint64_t getRxDrop(uint64_t defaultValue)
Get the value of rxDrop if set, otherwise the value of default passed in.
Definition: dfw/EpCounter.hpp:56
static boost::optional< OF_SHARED_PTR< modelgbp::dfw::EpCounter > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpCounter from the managed object store.
Definition: dfw/EpCounter.hpp:210
modelgbp::dfw::EpCounter & setUuid(const std::string &newValue)
Set uuid to the specified value in the currently-active mutator.
Definition: dfw/EpCounter.hpp:181