7 #ifndef __FWATOMS_SEQUENCE_HPP__ 8 #define __FWATOMS_SEQUENCE_HPP__ 10 #include "fwAtoms/Base.hpp" 11 #include "fwAtoms/config.hpp" 12 #include "fwAtoms/factory/new.hpp" 27 typedef std::vector<Base::sptr> SequenceType;
29 typedef SequenceType::value_type ValueType;
30 typedef SequenceType::reference ReferenceType;
31 typedef SequenceType::const_reference ConstReferenceType;
32 typedef SequenceType::iterator IteratorType;
33 typedef SequenceType::const_iterator ConstIteratorType;
34 typedef SequenceType::reverse_iterator ReverseIteratorType;
35 typedef SequenceType::const_reverse_iterator ConstReverseIteratorType;
36 typedef SequenceType::size_type SizeType;
70 m_value.push_back(value);
76 return m_value.begin();
88 return m_value.begin();
92 ConstIteratorType
end()
const 100 return m_value.size();
112 return m_value.empty();
124 return m_value[index];
128 const Base::sptr& operator[](
unsigned int index)
const 130 return m_value[index];
136 FWATOMS_API
virtual Base::sptr clone()
const override;
141 ::fwAtoms::Base::AtomType
type()
const override 143 return ::fwAtoms::Base::SEQUENCE;
147 SequenceType m_value;
151 #endif //__FWATOMS_SEQUENCE_HPP__ virtual ~Sequence()
Destructor.
bool empty() const
Test if the sequence is empty.
void push_back(const Base::sptr &value)
push an atom in the sequence.
ConstIteratorType begin() const
Begin of sequence const iterator.
fwAtoms contains basic objects to represent any other kind of object
IteratorType begin()
Begin of sequence iterator.
::fwAtoms::Base::AtomType type() const override
returns Atom type
SequenceType::const_iterator const_iterator
const SequenceType & getValue() const
Returns internal vector.
Sequence(::fwAtoms::Base::Key key)
Constructor.
ConstIteratorType end() const
End of sequence const iterator.
SequenceType::const_reverse_iterator const_reverse_iterator
SequenceType::value_type value_type
SequenceType::iterator iterator
IteratorType end()
End of sequence iterator.
SequenceType::const_reference const_reference
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
size_type size() const
Returns the sequence size.
SequenceType::reverse_iterator reverse_iterator
Base::sptr & operator[](unsigned int index)
access an element in position index
SequenceType::size_type size_type
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Base class for all Atom classes.
void clear()
clear the sequence
SequenceType::reference reference
Sequence represented a list of meta object.