27 #include "../common/STLUtils.h"
73 m_properties.push_back(p);
79 std::size_t size = ps.size();
81 for(std::size_t i = 0; i < size; ++i)
83 assert(ps[i]->getParent() == 0);
85 m_properties.push_back(ps[i]);
87 ps[i]->setParent(
this);
93 std::size_t size = ps.size();
95 for(std::size_t i = 0; i < size; ++i)
99 m_properties.push_back(p);
107 std::size_t size = m_properties.size();
109 for(std::size_t i = 0; i < size; ++i)
111 if(p == m_properties[i])
114 m_properties.erase(m_properties.begin() + i);
122 const std::size_t size = m_properties.size();
124 for(std::size_t i = 0; i < size; ++i)
125 if(m_properties[i]->getName() == name)
126 return m_properties[i];
133 const std::size_t size = m_properties.size();
135 for(std::size_t i = 0; i < size; ++i)
136 if(m_properties[i]->getName() == name)
139 return std::string::npos;
144 const std::size_t size = m_properties.size();
146 for(std::size_t i = 0; i < size; ++i)
147 if(m_properties[i] == p)
150 return std::string::npos;
155 const std::size_t size = m_properties.size();
157 for(std::size_t i = 0; i < size; ++i)
158 if(m_properties[i]->getId() ==
id)
159 return m_properties[i];
166 std::size_t size = ps.size();
168 m_properties.resize(m_properties.size() + size);
170 for(std::size_t i = 0; i < size; ++i)
183 m_properties.clear();
188 size_t size = m_properties.size();
190 for(
size_t i = 0; i < size; ++i)
192 if(m_properties[i] == p)
195 if(m_properties[i]->has(p))
Property * getProperty(std::size_t i) const
It returns the i-th property.
A base class for a compound property (non-atomic properties).
virtual void clear()
It clears the CompositeProperty definition.
bool has(Property *p) const
It checks if the Property "p" is associated to this property or any other parent. ...
A base class for a compound properties (non-atomic properties).
virtual Property * clone() const
It returns a clone of the object.
CompositeProperty(const std::string &cname, const std::string &name, unsigned int id=0, Property *parent=0)
It creates a new CompositeProperty.
virtual Property * clone() const =0
It returns a clone of the object.
Property & operator=(const Property &rhs)
Assignment operator.
std::vector< Property * > m_properties
The list of property types that make the CompositeProperty.
It models a property definition.
virtual ~CompositeProperty()
Virtual destructor.
CompositeProperty & operator=(const CompositeProperty &rhs)
Assignment operator.
Property * getPropertyById(unsigned int id) const
It searches for a property with the given ID.
Property * getParent() const
It returns the parent of this property, or NULL, if it doesn't have one.
void copy(const std::vector< Property * > &ps)
It copies the properties from the vector.
virtual void remove(Property *p)
It removes the property from the composite.
General enumerations for the data type module.
std::size_t getPropertyPosition(const std::string &name) const
It returns the property position based on its name.
void add(Property *p)
It adds a new property to the CompositeProperty.
std::string m_cname
The composite type name.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
void setParent(Property *p)
It associate this property to the informed parent.