modelgbp Generated OpFlex Model 1.7.0
SrcMember.hpp
1
10#pragma once
11#ifndef GI_SPAN_SRCMEMBER_HPP
12#define GI_SPAN_SRCMEMBER_HPP
13
14#include <boost/optional.hpp>
15#include "opflex/modb/URIBuilder.h"
16#include "opflex/modb/mo-internal/MO.h"
17/*
18 * contains: item:mclass(span/MemberToRefRSrc)
19 */
20#include "modelgbp/span/MemberToRefRSrc.hpp"
21
22namespace modelgbp {
23namespace span {
24
26 : public opflex::modb::mointernal::MO
27{
28public:
29
33 static const opflex::modb::class_id_t CLASS_ID = 77;
34
39 bool isDirSet()
40 {
41 return getObjectInstance().isSet(2523138ul, opflex::modb::PropertyInfo::ENUM8);
42 }
43
48 boost::optional<const uint8_t> getDir()
49 {
50 if (isDirSet())
51 return (const uint8_t)getObjectInstance().getUInt64(2523138ul);
52 return boost::none;
53 }
54
60 const uint8_t getDir(const uint8_t defaultValue)
61 {
62 return getDir().get_value_or(defaultValue);
63 }
64
73 modelgbp::span::SrcMember& setDir(const uint8_t newValue)
74 {
75 getTLMutator().modify(getClassId(), getURI())->setUInt64(2523138ul, newValue);
76 return *this;
77 }
78
86 {
87 getTLMutator().modify(getClassId(), getURI())->unset(2523138ul, opflex::modb::PropertyInfo::ENUM8, opflex::modb::PropertyInfo::SCALAR);
88 return *this;
89 }
90
95 bool isNameSet()
96 {
97 return getObjectInstance().isSet(2523137ul, opflex::modb::PropertyInfo::STRING);
98 }
99
104 boost::optional<const std::string&> getName()
105 {
106 if (isNameSet())
107 return getObjectInstance().getString(2523137ul);
108 return boost::none;
109 }
110
116 const std::string& getName(const std::string& defaultValue)
117 {
118 return getName().get_value_or(defaultValue);
119 }
120
129 modelgbp::span::SrcMember& setName(const std::string& newValue)
130 {
131 getTLMutator().modify(getClassId(), getURI())->setString(2523137ul, newValue);
132 return *this;
133 }
134
142 {
143 getTLMutator().modify(getClassId(), getURI())->unset(2523137ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
144 return *this;
145 }
146
158 static boost::optional<OF_SHARED_PTR<modelgbp::span::SrcMember> > resolve(
159 opflex::ofcore::OFFramework& framework,
160 const opflex::modb::URI& uri)
161 {
162 return opflex::modb::mointernal::MO::resolve<modelgbp::span::SrcMember>(framework, CLASS_ID, uri);
163 }
164
176 static boost::optional<OF_SHARED_PTR<modelgbp::span::SrcMember> > resolve(
177 const opflex::modb::URI& uri)
178 {
179 return opflex::modb::mointernal::MO::resolve<modelgbp::span::SrcMember>(opflex::ofcore::OFFramework::defaultInstance(), CLASS_ID, uri);
180 }
181
202 static boost::optional<OF_SHARED_PTR<modelgbp::span::SrcMember> > resolveUnderPolicyUniversePlatformConfigSpanSrcGrp(
203 opflex::ofcore::OFFramework& framework,
204 const std::string& platformConfigName,
205 const std::string& spanSrcGrpName,
206 const std::string& spanSrcMemberName)
207 {
208 return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanSrcGrp").addElement(spanSrcGrpName).addElement("SpanSrcMember").addElement(spanSrcMemberName).build());
209 }
210
230 static boost::optional<OF_SHARED_PTR<modelgbp::span::SrcMember> > resolveUnderPolicyUniversePlatformConfigSpanSrcGrp(
231 const std::string& platformConfigName,
232 const std::string& spanSrcGrpName,
233 const std::string& spanSrcMemberName)
234 {
235 return resolveUnderPolicyUniversePlatformConfigSpanSrcGrp(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanSrcGrpName,spanSrcMemberName);
236 }
237
258 static boost::optional<OF_SHARED_PTR<modelgbp::span::SrcMember> > resolveUnderPolicyUniversePlatformConfigSpanDstGrp(
259 opflex::ofcore::OFFramework& framework,
260 const std::string& platformConfigName,
261 const std::string& spanDstGrpName,
262 const std::string& spanSrcMemberName)
263 {
264 return resolve(framework,opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanDstGrp").addElement(spanDstGrpName).addElement("SpanSrcMember").addElement(spanSrcMemberName).build());
265 }
266
286 static boost::optional<OF_SHARED_PTR<modelgbp::span::SrcMember> > resolveUnderPolicyUniversePlatformConfigSpanDstGrp(
287 const std::string& platformConfigName,
288 const std::string& spanDstGrpName,
289 const std::string& spanSrcMemberName)
290 {
291 return resolveUnderPolicyUniversePlatformConfigSpanDstGrp(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanDstGrpName,spanSrcMemberName);
292 }
293
303 boost::optional<OF_SHARED_PTR<modelgbp::span::MemberToRefRSrc> > resolveSpanMemberToRefRSrc(
304 )
305 {
306 return modelgbp::span::MemberToRefRSrc::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement("SpanMemberToRefRSrc").build());
307 }
308
319 OF_SHARED_PTR<modelgbp::span::MemberToRefRSrc> addSpanMemberToRefRSrc(
320 )
321 {
322 OF_SHARED_PTR<modelgbp::span::MemberToRefRSrc> result = addChild<modelgbp::span::MemberToRefRSrc>(
323 CLASS_ID, getURI(), 2150006858ul, 74,
324 opflex::modb::URIBuilder(getURI()).addElement("SpanMemberToRefRSrc").build()
325 );
326 return result;
327 }
328
337 void remove()
338 {
339 getTLMutator().remove(CLASS_ID, getURI());
340 }
341
352 static void remove(opflex::ofcore::OFFramework& framework,
353 const opflex::modb::URI& uri)
354 {
355 MO::remove(framework, CLASS_ID, uri);
356 }
357
368 static void remove(const opflex::modb::URI& uri)
369 {
370 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
371 }
372
392 opflex::ofcore::OFFramework& framework,
393 const std::string& platformConfigName,
394 const std::string& spanSrcGrpName,
395 const std::string& spanSrcMemberName)
396 {
397 MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanSrcGrp").addElement(spanSrcGrpName).addElement("SpanSrcMember").addElement(spanSrcMemberName).build());
398 }
399
419 const std::string& platformConfigName,
420 const std::string& spanSrcGrpName,
421 const std::string& spanSrcMemberName)
422 {
423 removeUnderPolicyUniversePlatformConfigSpanSrcGrp(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanSrcGrpName,spanSrcMemberName);
424 }
425
445 opflex::ofcore::OFFramework& framework,
446 const std::string& platformConfigName,
447 const std::string& spanDstGrpName,
448 const std::string& spanSrcMemberName)
449 {
450 MO::remove(framework, CLASS_ID, opflex::modb::URIBuilder().addElement("PolicyUniverse").addElement("PlatformConfig").addElement(platformConfigName).addElement("SpanDstGrp").addElement(spanDstGrpName).addElement("SpanSrcMember").addElement(spanSrcMemberName).build());
451 }
452
472 const std::string& platformConfigName,
473 const std::string& spanDstGrpName,
474 const std::string& spanSrcMemberName)
475 {
476 removeUnderPolicyUniversePlatformConfigSpanDstGrp(opflex::ofcore::OFFramework::defaultInstance(),platformConfigName,spanDstGrpName,spanSrcMemberName);
477 }
478
490 static void registerListener(
491 opflex::ofcore::OFFramework& framework,
492 opflex::modb::ObjectListener* listener)
493 {
494 opflex::modb::mointernal
495 ::MO::registerListener(framework, listener, CLASS_ID);
496 }
497
509 static void registerListener(
510 opflex::modb::ObjectListener* listener)
511 {
512 registerListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
513 }
514
522 opflex::ofcore::OFFramework& framework,
523 opflex::modb::ObjectListener* listener)
524 {
525 opflex::modb::mointernal
526 ::MO::unregisterListener(framework, listener, CLASS_ID);
527 }
528
536 opflex::modb::ObjectListener* listener)
537 {
538 unregisterListener(opflex::ofcore::OFFramework::defaultInstance(), listener);
539 }
540
546 opflex::ofcore::OFFramework& framework,
547 const opflex::modb::URI& uri,
548 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
549 : MO(framework, CLASS_ID, uri, oi) { }
550}; // class SrcMember
551
552} // namespace span
553} // namespace modelgbp
554#endif // GI_SPAN_SRCMEMBER_HPP
static boost::optional< OF_SHARED_PTR< modelgbp::span::MemberToRefRSrc > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of MemberToRefRSrc from the managed object store.
Definition MemberToRefRSrc.hpp:297
Definition SrcMember.hpp:27
void remove()
Remove this instance using the currently-active mutator.
Definition SrcMember.hpp:337
static boost::optional< OF_SHARED_PTR< modelgbp::span::SrcMember > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of SrcMember from the managed object store using the default framework instance.
Definition SrcMember.hpp:176
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition SrcMember.hpp:116
static boost::optional< OF_SHARED_PTR< modelgbp::span::SrcMember > > resolveUnderPolicyUniversePlatformConfigSpanSrcGrp(const std::string &platformConfigName, const std::string &spanSrcGrpName, const std::string &spanSrcMemberName)
Retrieve an instance of SrcMember from the default managed object store by constructing its URI from ...
Definition SrcMember.hpp:230
boost::optional< OF_SHARED_PTR< modelgbp::span::MemberToRefRSrc > > resolveSpanMemberToRefRSrc()
Retrieve the child object with the specified naming properties.
Definition SrcMember.hpp:303
bool isNameSet()
Check whether name has been set.
Definition SrcMember.hpp:95
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition SrcMember.hpp:521
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition SrcMember.hpp:535
static void removeUnderPolicyUniversePlatformConfigSpanDstGrp(const std::string &platformConfigName, const std::string &spanDstGrpName, const std::string &spanSrcMemberName)
Remove the SrcMember object with the specified path elements from the managed object store using the ...
Definition SrcMember.hpp:471
static void removeUnderPolicyUniversePlatformConfigSpanSrcGrp(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName, const std::string &spanSrcGrpName, const std::string &spanSrcMemberName)
Remove the SrcMember object with the specified path elements from the managed object store.
Definition SrcMember.hpp:391
static void removeUnderPolicyUniversePlatformConfigSpanSrcGrp(const std::string &platformConfigName, const std::string &spanSrcGrpName, const std::string &spanSrcMemberName)
Remove the SrcMember object with the specified path elements from the managed object store using the ...
Definition SrcMember.hpp:418
modelgbp::span::SrcMember & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition SrcMember.hpp:129
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 SrcMember.hpp:490
static void remove(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Remove the SrcMember object with the specified URI using the currently-active mutator.
Definition SrcMember.hpp:352
const uint8_t getDir(const uint8_t defaultValue)
Get the value of dir if set, otherwise the value of default passed in.
Definition SrcMember.hpp:60
modelgbp::span::SrcMember & setDir(const uint8_t newValue)
Set dir to the specified value in the currently-active mutator.
Definition SrcMember.hpp:73
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition SrcMember.hpp:104
static boost::optional< OF_SHARED_PTR< modelgbp::span::SrcMember > > resolveUnderPolicyUniversePlatformConfigSpanDstGrp(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName, const std::string &spanDstGrpName, const std::string &spanSrcMemberName)
Retrieve an instance of SrcMember from the managed object store by constructing its URI from the path...
Definition SrcMember.hpp:258
bool isDirSet()
Check whether dir has been set.
Definition SrcMember.hpp:39
SrcMember(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of SrcMember.
Definition SrcMember.hpp:545
boost::optional< const uint8_t > getDir()
Get the value of dir if it has been set.
Definition SrcMember.hpp:48
modelgbp::span::SrcMember & unsetDir()
Unset dir in the currently-active mutator.
Definition SrcMember.hpp:85
static void removeUnderPolicyUniversePlatformConfigSpanDstGrp(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName, const std::string &spanDstGrpName, const std::string &spanSrcMemberName)
Remove the SrcMember object with the specified path elements from the managed object store.
Definition SrcMember.hpp:444
static boost::optional< OF_SHARED_PTR< modelgbp::span::SrcMember > > resolveUnderPolicyUniversePlatformConfigSpanDstGrp(const std::string &platformConfigName, const std::string &spanDstGrpName, const std::string &spanSrcMemberName)
Retrieve an instance of SrcMember from the default managed object store by constructing its URI from ...
Definition SrcMember.hpp:286
static boost::optional< OF_SHARED_PTR< modelgbp::span::SrcMember > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SrcMember from the managed object store.
Definition SrcMember.hpp:158
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 SrcMember.hpp:509
modelgbp::span::SrcMember & unsetName()
Unset name in the currently-active mutator.
Definition SrcMember.hpp:141
OF_SHARED_PTR< modelgbp::span::MemberToRefRSrc > addSpanMemberToRefRSrc()
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition SrcMember.hpp:319
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for SrcMember.
Definition SrcMember.hpp:33
static boost::optional< OF_SHARED_PTR< modelgbp::span::SrcMember > > resolveUnderPolicyUniversePlatformConfigSpanSrcGrp(opflex::ofcore::OFFramework &framework, const std::string &platformConfigName, const std::string &spanSrcGrpName, const std::string &spanSrcMemberName)
Retrieve an instance of SrcMember from the managed object store by constructing its URI from the path...
Definition SrcMember.hpp:202
static void remove(const opflex::modb::URI &uri)
Remove the SrcMember object with the specified URI using the currently-active mutator and the default...
Definition SrcMember.hpp:368
SOME COPYRIGHT.
Definition OpcodeEnumT.hpp:12