11 #ifndef GI_GBP_CONTRACT_HPP
12 #define GI_GBP_CONTRACT_HPP
14 #include <boost/optional.hpp>
15 #include "opflex/modb/URIBuilder.h"
16 #include "opflex/modb/mo-internal/MO.h"
20 #include "modelgbp/gbp/Subject.hpp"
24 #include "modelgbp/gbp/EpGroupFromProvContractRTgt.hpp"
28 #include "modelgbp/gbp/EpGroupFromConsContractRTgt.hpp"
32 #include "modelgbp/gbp/EpGroupFromIntraContractRTgt.hpp"
36 #include "modelgbp/gbp/EpGroupFromTabooContractRTgt.hpp"
40 #include "modelgbp/gbp/L3ExternalNetworkFromProvContractRTgt.hpp"
44 #include "modelgbp/gbp/L3ExternalNetworkFromConsContractRTgt.hpp"
50 :
public opflex::modb::mointernal::MO
57 static const opflex::modb::class_id_t
CLASS_ID = 152;
65 return getObjectInstance().isSet(4980737ul, opflex::modb::PropertyInfo::STRING);
72 boost::optional<const std::string&>
getName()
75 return getObjectInstance().getString(4980737ul);
84 const std::string&
getName(
const std::string& defaultValue)
86 return getName().get_value_or(defaultValue);
99 getTLMutator().modify(getClassId(), getURI())->setString(4980737ul, newValue);
111 getTLMutator().modify(getClassId(), getURI())->unset(4980737ul, opflex::modb::PropertyInfo::STRING, opflex::modb::PropertyInfo::SCALAR);
126 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Contract> >
resolve(
127 opflex::ofcore::OFFramework& framework,
128 const opflex::modb::URI& uri)
130 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::Contract>(framework,
CLASS_ID, uri);
144 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Contract> >
resolve(
145 const opflex::modb::URI& uri)
147 return opflex::modb::mointernal::MO::resolve<modelgbp::gbp::Contract>(opflex::ofcore::OFFramework::defaultInstance(),
CLASS_ID, uri);
168 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Contract> >
resolve(
169 opflex::ofcore::OFFramework& framework,
170 const std::string& policySpaceName,
171 const std::string& gbpContractName)
173 return resolve(framework,opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpContract").addElement(gbpContractName).build());
193 static boost::optional<OF_SHARED_PTR<modelgbp::gbp::Contract> >
resolve(
194 const std::string& policySpaceName,
195 const std::string& gbpContractName)
197 return resolve(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpContractName);
212 const std::string& gbpSubjectName)
214 return modelgbp::gbp::Subject::resolve(getFramework(), opflex::modb::URIBuilder(getURI()).addElement(
"GbpSubject").addElement(gbpSubjectName).build());
230 const std::string& gbpSubjectName)
232 OF_SHARED_PTR<modelgbp::gbp::Subject> result = addChild<modelgbp::gbp::Subject>(
233 CLASS_ID, getURI(), 2152464537ul, 153,
234 opflex::modb::URIBuilder(getURI()).addElement(
"GbpSubject").addElement(gbpSubjectName).build()
236 result->setName(gbpSubjectName);
256 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::Subject>(
257 getFramework(),
CLASS_ID, getURI(), 2152464537ul, 153, out);
272 const std::string& gbpEpGroupFromProvContractRTgtSource)
290 const std::string& gbpEpGroupFromProvContractRTgtSource)
292 OF_SHARED_PTR<modelgbp::gbp::EpGroupFromProvContractRTgt> result = addChild<modelgbp::gbp::EpGroupFromProvContractRTgt>(
293 CLASS_ID, getURI(), 2152464550ul, 166,
294 opflex::modb::URIBuilder(getURI()).addElement(
"GbpEpGroupFromProvContractRTgt").addElement(gbpEpGroupFromProvContractRTgtSource).build()
296 result->setSource(gbpEpGroupFromProvContractRTgtSource);
316 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::EpGroupFromProvContractRTgt>(
317 getFramework(),
CLASS_ID, getURI(), 2152464550ul, 166, out);
332 const std::string& gbpEpGroupFromConsContractRTgtSource)
350 const std::string& gbpEpGroupFromConsContractRTgtSource)
352 OF_SHARED_PTR<modelgbp::gbp::EpGroupFromConsContractRTgt> result = addChild<modelgbp::gbp::EpGroupFromConsContractRTgt>(
353 CLASS_ID, getURI(), 2152464553ul, 169,
354 opflex::modb::URIBuilder(getURI()).addElement(
"GbpEpGroupFromConsContractRTgt").addElement(gbpEpGroupFromConsContractRTgtSource).build()
356 result->setSource(gbpEpGroupFromConsContractRTgtSource);
376 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::EpGroupFromConsContractRTgt>(
377 getFramework(),
CLASS_ID, getURI(), 2152464553ul, 169, out);
392 const std::string& gbpEpGroupFromIntraContractRTgtSource)
410 const std::string& gbpEpGroupFromIntraContractRTgtSource)
412 OF_SHARED_PTR<modelgbp::gbp::EpGroupFromIntraContractRTgt> result = addChild<modelgbp::gbp::EpGroupFromIntraContractRTgt>(
413 CLASS_ID, getURI(), 2152464556ul, 172,
414 opflex::modb::URIBuilder(getURI()).addElement(
"GbpEpGroupFromIntraContractRTgt").addElement(gbpEpGroupFromIntraContractRTgtSource).build()
416 result->setSource(gbpEpGroupFromIntraContractRTgtSource);
436 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::EpGroupFromIntraContractRTgt>(
437 getFramework(),
CLASS_ID, getURI(), 2152464556ul, 172, out);
452 const std::string& gbpEpGroupFromTabooContractRTgtSource)
470 const std::string& gbpEpGroupFromTabooContractRTgtSource)
472 OF_SHARED_PTR<modelgbp::gbp::EpGroupFromTabooContractRTgt> result = addChild<modelgbp::gbp::EpGroupFromTabooContractRTgt>(
473 CLASS_ID, getURI(), 2152464559ul, 175,
474 opflex::modb::URIBuilder(getURI()).addElement(
"GbpEpGroupFromTabooContractRTgt").addElement(gbpEpGroupFromTabooContractRTgtSource).build()
476 result->setSource(gbpEpGroupFromTabooContractRTgtSource);
496 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::EpGroupFromTabooContractRTgt>(
497 getFramework(),
CLASS_ID, getURI(), 2152464559ul, 175, out);
512 const std::string& gbpL3ExternalNetworkFromProvContractRTgtSource)
530 const std::string& gbpL3ExternalNetworkFromProvContractRTgtSource)
532 OF_SHARED_PTR<modelgbp::gbp::L3ExternalNetworkFromProvContractRTgt> result = addChild<modelgbp::gbp::L3ExternalNetworkFromProvContractRTgt>(
533 CLASS_ID, getURI(), 2152464567ul, 183,
534 opflex::modb::URIBuilder(getURI()).addElement(
"GbpL3ExternalNetworkFromProvContractRTgt").addElement(gbpL3ExternalNetworkFromProvContractRTgtSource).build()
536 result->setSource(gbpL3ExternalNetworkFromProvContractRTgtSource);
556 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::L3ExternalNetworkFromProvContractRTgt>(
557 getFramework(),
CLASS_ID, getURI(), 2152464567ul, 183, out);
572 const std::string& gbpL3ExternalNetworkFromConsContractRTgtSource)
590 const std::string& gbpL3ExternalNetworkFromConsContractRTgtSource)
592 OF_SHARED_PTR<modelgbp::gbp::L3ExternalNetworkFromConsContractRTgt> result = addChild<modelgbp::gbp::L3ExternalNetworkFromConsContractRTgt>(
593 CLASS_ID, getURI(), 2152464570ul, 186,
594 opflex::modb::URIBuilder(getURI()).addElement(
"GbpL3ExternalNetworkFromConsContractRTgt").addElement(gbpL3ExternalNetworkFromConsContractRTgtSource).build()
596 result->setSource(gbpL3ExternalNetworkFromConsContractRTgtSource);
616 opflex::modb::mointernal::MO::resolveChildren<modelgbp::gbp::L3ExternalNetworkFromConsContractRTgt>(
617 getFramework(),
CLASS_ID, getURI(), 2152464570ul, 186, out);
630 getTLMutator().remove(
CLASS_ID, getURI());
643 static void remove(opflex::ofcore::OFFramework& framework,
644 const opflex::modb::URI& uri)
646 MO::remove(framework,
CLASS_ID, uri);
659 static void remove(
const opflex::modb::URI& uri)
661 remove(opflex::ofcore::OFFramework::defaultInstance(), uri);
681 opflex::ofcore::OFFramework& framework,
682 const std::string& policySpaceName,
683 const std::string& gbpContractName)
685 MO::remove(framework,
CLASS_ID, opflex::modb::URIBuilder().addElement(
"PolicyUniverse").addElement(
"PolicySpace").addElement(policySpaceName).addElement(
"GbpContract").addElement(gbpContractName).build());
705 const std::string& policySpaceName,
706 const std::string& gbpContractName)
708 remove(opflex::ofcore::OFFramework::defaultInstance(),policySpaceName,gbpContractName);
723 opflex::ofcore::OFFramework& framework,
724 opflex::modb::ObjectListener* listener)
726 opflex::modb::mointernal
727 ::MO::registerListener(framework, listener,
CLASS_ID);
742 opflex::modb::ObjectListener* listener)
754 opflex::ofcore::OFFramework& framework,
755 opflex::modb::ObjectListener* listener)
757 opflex::modb::mointernal
758 ::MO::unregisterListener(framework, listener,
CLASS_ID);
768 opflex::modb::ObjectListener* listener)
778 opflex::ofcore::OFFramework& framework,
779 const opflex::modb::URI& uri,
780 const OF_SHARED_PTR<const opflex::modb::mointernal::ObjectInstance>& oi)
781 : MO(framework,
CLASS_ID, uri, oi) { }
786 #endif // GI_GBP_CONTRACT_HPP
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: Contract.hpp:741
boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromProvContractRTgt > > resolveGbpEpGroupFromProvContractRTgt(const std::string &gbpEpGroupFromProvContractRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: Contract.hpp:271
OF_SHARED_PTR< modelgbp::gbp::EpGroupFromTabooContractRTgt > addGbpEpGroupFromTabooContractRTgt(const std::string &gbpEpGroupFromTabooContractRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Contract.hpp:469
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Contract > > resolve(const std::string &policySpaceName, const std::string &gbpContractName)
Retrieve an instance of Contract from the default managed object store by constructing its URI from t...
Definition: Contract.hpp:193
boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromTabooContractRTgt > > resolveGbpEpGroupFromTabooContractRTgt(const std::string &gbpEpGroupFromTabooContractRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: Contract.hpp:451
void resolveGbpEpGroupFromConsContractRTgt(std::vector< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromConsContractRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::EpGroupFromConsContractRTgt...
Definition: Contract.hpp:374
OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromConsContractRTgt > addGbpL3ExternalNetworkFromConsContractRTgt(const std::string &gbpL3ExternalNetworkFromConsContractRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Contract.hpp:589
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromConsContractRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of L3ExternalNetworkFromConsContractRTgt from the managed object store...
Definition: L3ExternalNetworkFromConsContractRTgt.hpp:210
OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromProvContractRTgt > addGbpL3ExternalNetworkFromProvContractRTgt(const std::string &gbpL3ExternalNetworkFromProvContractRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Contract.hpp:529
OF_SHARED_PTR< modelgbp::gbp::EpGroupFromProvContractRTgt > addGbpEpGroupFromProvContractRTgt(const std::string &gbpEpGroupFromProvContractRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Contract.hpp:289
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromIntraContractRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpGroupFromIntraContractRTgt from the managed object store.
Definition: EpGroupFromIntraContractRTgt.hpp:210
boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromIntraContractRTgt > > resolveGbpEpGroupFromIntraContractRTgt(const std::string &gbpEpGroupFromIntraContractRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: Contract.hpp:391
static void unregisterListener(opflex::ofcore::OFFramework &framework, opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class.
Definition: Contract.hpp:753
Definition: Contract.hpp:49
void resolveGbpL3ExternalNetworkFromProvContractRTgt(std::vector< OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromProvContractRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::L3ExternalNetworkFromProvCo...
Definition: Contract.hpp:554
OF_SHARED_PTR< modelgbp::gbp::EpGroupFromIntraContractRTgt > addGbpEpGroupFromIntraContractRTgt(const std::string &gbpEpGroupFromIntraContractRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Contract.hpp:409
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromConsContractRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpGroupFromConsContractRTgt from the managed object store.
Definition: EpGroupFromConsContractRTgt.hpp:210
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Contract > > resolve(opflex::ofcore::OFFramework &framework, const std::string &policySpaceName, const std::string &gbpContractName)
Retrieve an instance of Contract from the managed object store by constructing its URI from the path ...
Definition: Contract.hpp:168
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromProvContractRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpGroupFromProvContractRTgt from the managed object store.
Definition: EpGroupFromProvContractRTgt.hpp:210
static void unregisterListener(opflex::modb::ObjectListener *listener)
Unregister a listener from updates to this class from the default framework instance.
Definition: Contract.hpp:767
bool isNameSet()
Check whether name has been set.
Definition: Contract.hpp:63
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Contract > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Contract from the managed object store.
Definition: Contract.hpp:126
void resolveGbpSubject(std::vector< OF_SHARED_PTR< modelgbp::gbp::Subject > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::Subject.
Definition: Contract.hpp:254
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Contract > > resolve(const opflex::modb::URI &uri)
Retrieve an instance of Contract from the managed object store using the default framework instance...
Definition: Contract.hpp:144
boost::optional< const std::string & > getName()
Get the value of name if it has been set.
Definition: Contract.hpp:72
boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromConsContractRTgt > > resolveGbpEpGroupFromConsContractRTgt(const std::string &gbpEpGroupFromConsContractRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: Contract.hpp:331
boost::optional< OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromConsContractRTgt > > resolveGbpL3ExternalNetworkFromConsContractRTgt(const std::string &gbpL3ExternalNetworkFromConsContractRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: Contract.hpp:571
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: Contract.hpp:722
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromTabooContractRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of EpGroupFromTabooContractRTgt from the managed object store.
Definition: EpGroupFromTabooContractRTgt.hpp:210
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromProvContractRTgt > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of L3ExternalNetworkFromProvContractRTgt from the managed object store...
Definition: L3ExternalNetworkFromProvContractRTgt.hpp:210
Contract(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri, const OF_SHARED_PTR< const opflex::modb::mointernal::ObjectInstance > &oi)
Construct an instance of Contract.
Definition: Contract.hpp:777
void resolveGbpL3ExternalNetworkFromConsContractRTgt(std::vector< OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromConsContractRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::L3ExternalNetworkFromConsCo...
Definition: Contract.hpp:614
boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subject > > resolveGbpSubject(const std::string &gbpSubjectName)
Retrieve the child object with the specified naming properties.
Definition: Contract.hpp:211
static boost::optional< OF_SHARED_PTR< modelgbp::gbp::Subject > > resolve(opflex::ofcore::OFFramework &framework, const opflex::modb::URI &uri)
Retrieve an instance of Subject from the managed object store.
Definition: Subject.hpp:102
void resolveGbpEpGroupFromTabooContractRTgt(std::vector< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromTabooContractRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::EpGroupFromTabooContractRTg...
Definition: Contract.hpp:494
const std::string & getName(const std::string &defaultValue)
Get the value of name if set, otherwise the value of default passed in.
Definition: Contract.hpp:84
modelgbp::gbp::Contract & unsetName()
Unset name in the currently-active mutator.
Definition: Contract.hpp:109
OF_SHARED_PTR< modelgbp::gbp::Subject > addGbpSubject(const std::string &gbpSubjectName)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Contract.hpp:229
modelgbp::gbp::Contract & setName(const std::string &newValue)
Set name to the specified value in the currently-active mutator.
Definition: Contract.hpp:97
OF_SHARED_PTR< modelgbp::gbp::EpGroupFromConsContractRTgt > addGbpEpGroupFromConsContractRTgt(const std::string &gbpEpGroupFromConsContractRTgtSource)
Create a new child object with the specified naming properties and make it a child of this object in ...
Definition: Contract.hpp:349
void resolveGbpEpGroupFromProvContractRTgt(std::vector< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromProvContractRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::EpGroupFromProvContractRTgt...
Definition: Contract.hpp:314
static const opflex::modb::class_id_t CLASS_ID
The unique class ID for Contract.
Definition: Contract.hpp:57
void resolveGbpEpGroupFromIntraContractRTgt(std::vector< OF_SHARED_PTR< modelgbp::gbp::EpGroupFromIntraContractRTgt > > &out)
Resolve and retrieve all of the immediate children of type modelgbp::gbp::EpGroupFromIntraContractRTg...
Definition: Contract.hpp:434
boost::optional< OF_SHARED_PTR< modelgbp::gbp::L3ExternalNetworkFromProvContractRTgt > > resolveGbpL3ExternalNetworkFromProvContractRTgt(const std::string &gbpL3ExternalNetworkFromProvContractRTgtSource)
Retrieve the child object with the specified naming properties.
Definition: Contract.hpp:511