libSBOL
2.3.3
|
A container property that contains child objects.
Creates a composition out of two or more classes. In the SBOL specification, compositional relationships are indicated in class diagrams by arrows with black diamonds. A compositional relationship means that deleting the parent object will delete the child objects, and adding the parent object to a Document will also add the child object. Owned objects are stored in arbitrary order.
SBOLClass | The type of child SBOL object contained by this Property |
Classes | |
class | iterator |
Provides iterator functionality for SBOL properties that contain multiple objects. More... | |
Public Member Functions | |
OwnedObject (void *property_owner, rdf_type sbol_uri, char lower_bound, char upper_bound, ValidationRules validation_rules, SBOLObject &first_object) | |
Initialize a container and put the first object in it. More... | |
OwnedObject (void *property_owner, rdf_type sbol_uri, char lower_bound, char upper_bound, ValidationRules validation_rules) | |
Initialize a container property. More... | |
void | set (SBOLClass &sbol_obj) |
void | add (SBOLClass &sbol_obj) |
SBOLClass & | get (const std::string uri="") |
Get the child object. More... | |
template<class SBOLSubClass > | |
SBOLSubClass & | get (std::string uri="") |
Get the child object. More... | |
std::vector< SBOLClass * > | getAll () |
Get all the objects contained in the property. More... | |
SBOLClass & | remove (std::string uri) |
Remove an object from the list of objects. More... | |
void | remove (int index=0) override |
Remove an object from the list of objects and destroy it. More... | |
void | clear () override |
Remove all children objects from the parent and destroy them. | |
SBOLClass & | create (std::string uri) |
Autoconstructs a child object and attaches it to the parent object. More... | |
SBOLClass & | define (SBOLObject &definition_object) |
Autoconstructs a child object and attaches it to the parent object. More... | |
template<class SBOLSubClass > | |
SBOLSubClass & | create (std::string uri) |
bool | find (std::string uri) override |
SBOLClass & | operator[] (const int nIndex) |
Retrieve a child object by numerical index. | |
SBOLClass & | operator[] (std::string uri) |
Retrieve a child object by URI. | |
virtual void | set (std::string new_value) |
Basic setter for SBOL TextProperty and URIProperty. More... | |
virtual void | set (int new_value) |
Basic setter for SBOL IntProperty, but can be used with TextProperty as well. More... | |
virtual void | set (double new_value) |
Basic setter for SBOL IntProperty, but can be used with TextProperty as well. More... | |
void | add (std::string new_value) |
Appends the new value to a list of values, for properties that allow it. More... | |
void | copy (Property< SBOLClass > &target_property) |
Copy property values to a target object's property fields. | |
OwnedObject | ( | void * | property_owner, |
rdf_type | sbol_uri, | ||
char | lower_bound, | ||
char | upper_bound, | ||
ValidationRules | validation_rules, | ||
SBOLObject & | first_object | ||
) |
Initialize a container and put the first object in it.
Validation rules are checked upon initialization.
type_uri | An RDF type for the property which determines how the property is serialized in SBOL files |
lower_bound | A char flag (typically '0' or '1') indicating the minimum number of values allowed for this property |
upper_bound | A char flag (typically '1' or '*') indicating the maximum number of values allowed for this property |
validation_rules | A vector of pointers to the validation functions |
OwnedObject | ( | void * | property_owner, |
rdf_type | sbol_uri, | ||
char | lower_bound, | ||
char | upper_bound, | ||
ValidationRules | validation_rules | ||
) |
Initialize a container property.
No validation rules are run upon initialization.
type_uri | An RDF type for the property which determines how the property is serialized in SBOL files |
lower_bound | A char flag (typically '0' or '1') indicating the minimum number of values allowed for this property |
upper_bound | A char flag (typically '1' or '*') indicating the maximum number of values allowed for this property |
validation_rules | A vector of pointers to the validation functions |
|
inherited |
Appends the new value to a list of values, for properties that allow it.
new_value | A new string which will be added to a list of values. |
void add | ( | SBOLClass & | sbol_obj | ) |
SBOLClass | The type of SBOL object contained in this OwnedObject property |
sbol_obj | A child object to add to this container property. Adds a child object to the parent object. This method always appends another object to those already contained in this OwnedObject property. In SBOLCompliant mode, the create method is preferred |
SBOLSubClass & create | ( | std::string | uri | ) |
Autoconstructs a child object and attaches it to the parent object.
The new object will be constructed with default values specified in the constructor for this type of object. If SBOLCompliance is enabled, the child object's identity will be constructed using the supplied displayId argument. Otherwise, the user should supply a full URI.
SBOLClass | The type of SBOL object that will be created |
uri | If SBOLCompliance is enabled, this should be the displayId for the new child object. If not enabled, this should be a full raw URI. |
SBOLSubClass& create | ( | std::string | uri | ) |
SBOLClass | The type of SBOL object contained in this OwnedObject property |
SBOLSubClass | A derived class of SBOLClass. Use this specialization for OwnedObject properties which contain multiple types of SBOLObjects. |
uri | If SBOLCompliance is enabled, this should be the displayId for the new child object. If not enabled, this should be a full raw URI. |
SBOLClass & define | ( | SBOLObject & | definition_object | ) |
Autoconstructs a child object and attaches it to the parent object.
Additionally, it sets the definition property of the child object, for example, in the case of creating Components, FunctionalComponents, and Modules. The new object will be constructed with default values specified in the constructor for this type of object. If SBOLCompliance is enabled, the child object's identity will be constructed using the supplied displayId argument. Otherwise, the user should supply a full URI.
SBOLClass | The type of SBOL object that will be created |
definition_object | The returned object will reference the definition_object in its definition property. |
|
overridevirtual |
uri | The full uniform resource identifier of the object to search for in this property |
Reimplemented from Property< SBOLClass >.
SBOLSubClass & get | ( | const std::string | uri = "" | ) |
Get the child object.
SBOLClass | The type of SBOL object contained in this OwnedObject property |
SBOLSubClass | A derived class of SBOLClass. Use this type specialization when adding multiple types of SBOLObjects to a container. |
sbol_obj | A child object to add to this container property. Adds a child object to the parent object. This method always appends another object to those already contained in this OwnedObject property. In SBOLCompliant mode, the create method is preferred |
SBOLClass | The type of the child object |
uri | The URI of the child object |
SBOLSubClass& get | ( | std::string | uri = "" | ) |
Get the child object.
SBOLClass | The type of the child object |
SBOLSubClass | A derived class of SBOLClass. Use this type specialization when adding multiple types of SBOLObjects to a container. |
uri | The specific URI for a child object if this OwnedObject property contains multiple objects, |
std::vector< SBOLClass * > getAll | ( | ) |
Get all the objects contained in the property.
SBOLClass & remove | ( | std::string | uri | ) |
Remove an object from the list of objects.
uri | This can be a displayId of the object or a full URI may be provided. |
|
overridevirtual |
Remove an object from the list of objects and destroy it.
index | A numerical index for the object. |
Reimplemented from Property< SBOLClass >.
|
virtualinherited |
Basic setter for SBOL TextProperty and URIProperty.
new_value | A new string value for the Property. |
|
virtualinherited |
Basic setter for SBOL IntProperty, but can be used with TextProperty as well.
new_value | A new integer value for the property, which is converted to a raw string during serialization. |
|
virtualinherited |
Basic setter for SBOL IntProperty, but can be used with TextProperty as well.
new_value | A new integer value for the property, which is converted to a raw string during serialization. |
void set | ( | SBOLClass & | sbol_obj | ) |
SBOLClass | The type of SBOL object contained in this OwnedObject property |
sbol_obj | A child object to add to this container property. Assigns a child object to this OwnedObject container property. This method always overwrites the first SBOLObject in the container. appends another object to those already contained in this OwnedObject property. In SBOLCompliant mode, the create method is preferred |
sbol_obj | The child object Sets the first object in the container |