ADTF
|
Utility class for observable named items where the order is important. More...
Public Types | |
typedef DDL_TYPE_TO_ACCESS | access_type |
local definition of the access type | |
typedef std::shared_ptr< DDL_TYPE_TO_ACCESS > | value_type |
local definition of the value type | |
typedef std::vector< value_type > | container_type |
local definition of the container type | |
typedef container_type::iterator | iterator |
local definition of the container iterator | |
typedef container_type::const_iterator | const_iterator |
local definition of the container const_iterator | |
typedef TypeAccessVectorObserver< DDL_TYPE_TO_ACCESS > | parent_type |
local definition of the parent type to register observer | |
typedef TypeAccessVectorSubject< DDL_TYPE_TO_ACCESS > | observer_subject_type |
local definition of the internal subject type | |
typedef observer_subject_type::observer_type | observer_type |
local definition of the observer type | |
typedef parent_type::event_code_type | event_code_type |
local definition of the eventcode type | |
typedef parent_type::subject_type | subject_type |
local definition of the subject type | |
![]() | |
typedef EVENT_CODE_T | event_code_type |
local definition of the event code type | |
typedef MODEL_SUBJECT_T | subject_type |
local definition of the subject code type | |
Public Member Functions | |
TypeAccessVector ()=delete | |
no default CTOR! | |
TypeAccessVector (TYPE_VALIDATOR_CLASS *validator, const std::string &validation_info) | |
CTOR. More... | |
virtual | ~TypeAccessVector () |
DTOR. | |
TypeAccessVector (TypeAccessVector &&other) | |
move CTOR | |
TypeAccessVector & | operator= (TypeAccessVector &&other) |
move assignment operator More... | |
TypeAccessVector (const TypeAccessVector &other) | |
copies (deepcopy!) CTOR More... | |
TypeAccessVector & | operator= (const TypeAccessVector &other) |
copies (deepcopy!) and overwrite the current content. More... | |
std::shared_ptr< const DDL_TYPE_TO_ACCESS > | get (size_t index) const |
get the item with the given index More... | |
void | add (const DDL_TYPE_TO_ACCESS &type_to_add) |
adds the given item More... | |
void | insert (const size_t pos_idx, const DDL_TYPE_TO_ACCESS &type_to_add) |
inserts the given item at the given pos More... | |
void | emplace (DDL_TYPE_TO_ACCESS &&type_to_add) |
emplace the given item More... | |
void | remove (size_t index) |
item to remove More... | |
std::shared_ptr< DDL_TYPE_TO_ACCESS > | access (size_t index) |
change access to an item More... | |
size_t | getSize () const |
Get the Size. More... | |
iterator | begin () |
the range based begin iterator More... | |
iterator | end () |
the range based end iterator More... | |
const_iterator | cbegin () const |
const begin iterator access More... | |
const_iterator | cend () const |
const end iterator access More... | |
const_iterator | begin () const |
range based begin operator for const access More... | |
const_iterator | end () const |
range based end operator for const access More... | |
bool | operator== (const TypeAccessVector &other) const |
equality operator. More... | |
bool | operator!= (const TypeAccessVector &other) const |
non equality operator. More... | |
void | clear () |
clears the list and remove this as observer | |
void | popBack () |
removes the last element if exists. More... | |
void | modelChanged (event_code_type event_code, subject_type &subject_changed, const std::string &additional_info) |
overrides the observers utility function. More... | |
Public Attributes | |
friend | TYPE_VALIDATOR_CLASS |
friend validator class | |
Private Member Functions | |
void | deepCopy (TypeAccessVector &destination, TYPE_VALIDATOR_CLASS *validator) const |
copies the content of the of the list (by reseting the observer) and resets the validator to the given one. More... | |
void | setValidator (TYPE_VALIDATOR_CLASS *validator) |
Private Attributes | |
container_type | _types |
TYPE_VALIDATOR_CLASS * | _validator = {} |
std::string | _validation_info |
Additional Inherited Members | |
![]() | |
virtual | ~ModelObserverUtility () |
protected DTOR | |
Utility class for observable named items where the order is important.
DDL_TYPE_TO_ACCESS | the value type |
TYPE_VALIDATOR_CLASS | the validator class to inform on changes |
Definition at line 83 of file access_vector.h.
|
inline |
CTOR.
validator | the validator for name check! |
validation_info | info for errors |
Definition at line 120 of file access_vector.h.
|
inline |
copies (deepcopy!) CTOR
other | the other list |
Definition at line 166 of file access_vector.h.
|
inline |
change access to an item
index | the item index |
Definition at line 332 of file access_vector.h.
|
inline |
adds the given item
type_to_add | the item to add |
throws | if a item with that name already exists |
Definition at line 219 of file access_vector.h.
Referenced by TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::insert().
|
inline |
the range based begin iterator
Definition at line 355 of file access_vector.h.
Referenced by TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator==(), and TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::remove().
|
inline |
range based begin operator for const access
Definition at line 395 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::cbegin().
|
inline |
const begin iterator access
Definition at line 375 of file access_vector.h.
Referenced by TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::begin(), and TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::insert().
|
inline |
const end iterator access
Definition at line 385 of file access_vector.h.
Referenced by TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::end().
|
inlineprivate |
copies the content of the of the list (by reseting the observer) and resets the validator to the given one.
destination | the destination list where to copy the content of this. |
validator | the validator to set in the destination! |
Definition at line 500 of file access_vector.h.
|
inline |
emplace the given item
type_to_add | the item to emplace |
throws | if a item with that name already exists |
Definition at line 276 of file access_vector.h.
Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createTarget().
|
inline |
the range based end iterator
Definition at line 365 of file access_vector.h.
Referenced by TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator==().
|
inline |
range based end operator for const access
Definition at line 405 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::cend().
|
inline |
get the item with the given index
index | the item to find |
Definition at line 204 of file access_vector.h.
|
inline |
Get the Size.
Definition at line 345 of file access_vector.h.
Referenced by TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::insert().
|
inline |
inserts the given item at the given pos
type_to_add | the item to insert |
pos_idx | the pos where to insert the item |
throws | if a item with that name already exists, or the pos_idx is invalid or out of range |
Definition at line 242 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::add(), TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::cbegin(), and TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::getSize().
|
inlinevirtual |
overrides the observers utility function.
event_code | the internal event_code |
subject_changed | the subject (these are the items of the list) |
additional_info | the additional info (if any) |
Implements ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T >.
Definition at line 481 of file access_vector.h.
|
inline |
non equality operator.
other | the other TypeAccessList to compare this list to. |
Definition at line 432 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator==().
|
inline |
copies (deepcopy!) and overwrite the current content.
other | the other list |
Definition at line 183 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::clear().
|
inline |
move assignment operator
Definition at line 144 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::clear().
|
inline |
equality operator.
other | the other TypeAccessList to compare this list to. |
Definition at line 417 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::begin(), and TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::end().
Referenced by TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator!=().
|
inline |
removes the last element if exists.
ddl::dd::Error | if it is empty. |
Definition at line 455 of file access_vector.h.
|
inline |
item to remove
index | the item index to remove |
Definition at line 295 of file access_vector.h.
References TypeAccessVector< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::begin().