11 #ifndef GI_GBP_SECGROUPSUBJECT_HPP 12 #define GI_GBP_SECGROUPSUBJECT_HPP 14 #include <boost/optional.hpp> 15 #include "opflex/modb/URIBuilder.h" 16 #include "opflex/modb/mo-internal/MO.h" 20 #include "modelgbp/gbp/SecGroupRule.hpp" 26 :
public opflex::modb::mointernal::MO
33 static const opflex::modb::class_id_t
CLASS_ID = 204;
41 return getObjectInstance().isSet(6684673ul, opflex::modb::PropertyInfo::STRING);
48 boost::optional<const std::string&>
getName()
51 return getObjectInstance().getString(6684673ul);
60 const std::string&
getName(
const std::string& defaultValue)
62 return getName().get_value_or(defaultValue);
75 getTLMutator().modify(getClassId(), getURI())->setString(6684673ul, newValue);
87 getTLMutator().modify(getClassId(), getURI())->unset(6684673ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
102 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::SecGroupSubject> >
resolve(
103 opflex::ofcore::OFFramework& framework,
104 const opflex::modb::URI& uri)
106 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroupSubject>(framework,
CLASS_ID, uri);
120 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::SecGroupSubject> >
resolve(
121 const opflex::modb::URI& uri)
123 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::SecGroupSubject>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
146 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::SecGroupSubject> >
resolve(
147 opflex::ofcore::OFFramework& framework,
148 const std::string& policySpaceName,
149 const std::string& gbpSecGroupName,
150 const std::string& gbpSecGroupSubjectName)
152 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpSecGroup").addElement(gbpSecGroupName).addElement(
"GbpSecGroupSubject").addElement(gbpSecGroupSubjectName).build());
174 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::SecGroupSubject> >
resolve(
175 const std::string& policySpaceName,
176 const std::string& gbpSecGroupName,
177 const std::string& gbpSecGroupSubjectName)
179 return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSecGroupName,gbpSecGroupSubjectName);
194 const std::string& gbpSecGroupRuleName)
212 const std::string& gbpSecGroupRuleName)
214 OF_SHARED_PTR<modelgbp::gbp::SecGroupRule> result = addChild<modelgbp::gbp::SecGroupRule>(
215 CLASS_ID, getURI(), 2154168525ul, 205,
216 opflex::modb::URIBuilder(getURI()).addElement(
"GbpSecGroupRule").addElement(gbpSecGroupRuleName).build()
218 result->setName(gbpSecGroupRuleName);
238 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::SecGroupRule>(
239 getFramework(),
CLASS_ID, getURI(), 2154168525ul, 205, out);
252 getTLMutator().remove(
CLASS_ID, getURI());
265 static void remove(opflex::ofcore::OFFramework& framework,
266 const opflex::modb::URI& uri)
268 MO::remove(framework,
CLASS_ID, uri);
281 static void remove(
const opflex::modb::URI& uri)
283 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
305 opflex::ofcore::OFFramework& framework,
306 const std::string& policySpaceName,
307 const std::string& gbpSecGroupName,
308 const std::string& gbpSecGroupSubjectName)
310 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpSecGroup").addElement(gbpSecGroupName).addElement(
"GbpSecGroupSubject").addElement(gbpSecGroupSubjectName).build());
332 const std::string& policySpaceName,
333 const std::string& gbpSecGroupName,
334 const std::string& gbpSecGroupSubjectName)
336 remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpSecGroupName,gbpSecGroupSubjectName);
351 opflex::ofcore::OFFramework& framework,
352 opflex::modb::ObjectListener* listener)
354 opflex::modb::mointernal
355 ::MO::registerListener(framework, listener,
CLASS_ID);
370 opflex::modb::ObjectListener* listener)
382 opflex::ofcore::OFFramework& framework,
383 opflex::modb::ObjectListener* listener)
385 opflex::modb::mointernal
386 ::MO::unregisterListener(framework, listener,
CLASS_ID);
396 opflex::modb::ObjectListener* listener)
406 opflex::ofcore::OFFramework& framework,
407 const opflex::modb::URI& uri,
408 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
409 : MO(framework,
CLASS_ID, uri, oi) { }
414 #endif // GI_GBP_SECGROUPSUBJECT_HPP static boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroupSubject > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpSecGroupName, const std::string &gbpSecGroupSubjectName)
Retrieve an instance of SecGroupSubject from the managed object store by constructing its URI from th...
Definition: SecGroupSubject.hpp:146
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroupSubject > > resolve(const std::string &policySpaceName, const std::string &gbpSecGroupName, const std::string &gbpSecGroupSubjectName)
Retrieve an instance of SecGroupSubject from the default managed object store by constructing its URI...
Definition: SecGroupSubject.hpp:174
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroupSubject > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of SecGroupSubject from the managed object store using the default framework ins...
Definition: SecGroupSubject.hpp:120
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: SecGroupSubject.hpp:395
modelgbp::gbp::SecGroupSubject & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: SecGroupSubject.hpp:73
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: SecGroupSubject.hpp:369
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroupRule > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroupRule from the managed object store.
Definition: SecGroupRule.hpp:222
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for SecGroupSubject.
Definition: SecGroupSubject.hpp:33
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: SecGroupSubject.hpp:381
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: SecGroupSubject.hpp:60
boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroupRule > > resolveGbpSecGroupRule(const std::string &gbpSecGroupRuleName)
Retrieve the child object with the specified naming properties.
Definition: SecGroupSubject.hpp:193
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: SecGroupSubject.hpp:48
modelgbp::gbp::SecGroupSubject & unsetName()
Unset name in the currently-active mutator.
Definition: SecGroupSubject.hpp:85
void resolveGbpSecGroupRule(std::vector< OF_SHARED_PTR< modelgbp::gbp::SecGroupRule > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::SecGroupRule.
Definition: SecGroupSubject.hpp:236
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::SecGroupSubject > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of SecGroupSubject from the managed object store.
Definition: SecGroupSubject.hpp:102
OF_SHARED_PTR< modelgbp::gbp::SecGroupRule > addGbpSecGroupRule(const std::string &gbpSecGroupRuleName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: SecGroupSubject.hpp:211
Definition: SecGroupSubject.hpp:25
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: SecGroupSubject.hpp:350
bool isNameSet()
Check whether name has been set.
Definition: SecGroupSubject.hpp:39
SOME COPYRIGHT.
Definition: OpcodeEnumT.hpp:12
SecGroupSubject(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of SecGroupSubject.
Definition: SecGroupSubject.hpp:405