ADTF
|
Utility class for observable named items where the order is NOT 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::unordered_map< std::string, 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 TypeAccessMapObserver< DDL_TYPE_TO_ACCESS > | parent_type |
local definition of the parent type to register observe | |
typedef TypeAccessMapSubject< DDL_TYPE_TO_ACCESS > | map_subject_type |
local definition of the internal subject type | |
typedef map_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 | |
Public Types inherited from ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T > | |
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 | |
TypeAccessMap ()=delete | |
no default CTOR! | |
TypeAccessMap (TYPE_VALIDATOR_CLASS *validator, const std::string &validation_info) | |
CTOR. More... | |
virtual | ~TypeAccessMap () |
DTOR. | |
TypeAccessMap (TypeAccessMap &&other) | |
move CTOR | |
TypeAccessMap & | operator= (TypeAccessMap &&other) |
move assignment operator More... | |
TypeAccessMap (const TypeAccessMap &other) | |
copies (deepcopy!) CTOR More... | |
TypeAccessMap & | operator= (const TypeAccessMap &other) |
copies (deepcopy!) and overwrite the current content. More... | |
std::shared_ptr< const DDL_TYPE_TO_ACCESS > | get (const std::string &type_name) const |
get the item with the given name type_name More... | |
bool | contains (const std::string &type_name) const |
determines is the type name exists in this map More... | |
bool | contains (const DDL_TYPE_TO_ACCESS &type_to_find) const |
determines if the item is in this map. More... | |
bool | contains (const TypeAccessMap &other) const |
determines if the other is a subset of this map More... | |
std::shared_ptr< DDL_TYPE_TO_ACCESS > | create (const DDL_TYPE_TO_ACCESS &type_to_add) |
creates the given item by copy More... | |
void | add (const DDL_TYPE_TO_ACCESS &type_to_add) |
adds the given item More... | |
std::shared_ptr< DDL_TYPE_TO_ACCESS > | create (DDL_TYPE_TO_ACCESS &&type_to_add) |
creates the given item in place More... | |
void | emplace (DDL_TYPE_TO_ACCESS &&type_to_add) |
emplaces the given item More... | |
void | remove (const std::string &type_name) |
item to remove More... | |
std::shared_ptr< DDL_TYPE_TO_ACCESS > | access (const std::string &type_name) |
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 TypeAccessMap &other) const |
equality operator. More... | |
bool | operator!= (const TypeAccessMap &other) const |
non equality operator. More... | |
void | clear () |
clears the list and remove this as observer | |
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 (TypeAccessMap &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... | |
Private Attributes | |
container_type | _types |
TYPE_VALIDATOR_CLASS * | _validator |
std::string | _validation_info |
Additional Inherited Members | |
Protected Member Functions inherited from ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T > | |
virtual | ~ModelObserverUtility () |
protected DTOR | |
Utility class for observable named items where the order is NOT important.
DDL_TYPE_TO_ACCESS | the value type |
TYPE_VALIDATOR_CLASS | the validator class to inform on changes |
Definition at line 79 of file access_map.h.
|
inline |
CTOR.
validator | the validator for name check! |
validation_info | info for errors |
Definition at line 116 of file access_map.h.
|
inline |
|
inline |
change access to an item
type_name | the item name |
Definition at line 404 of file access_map.h.
Referenced by TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::create(), and TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::remove().
|
inline |
adds the given item
type_to_add | the item to add |
throws | if a item with that name already exists |
Definition at line 310 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::create().
|
inline |
|
inline |
range based begin operator for const access
Definition at line 462 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::cbegin().
|
inline |
const begin iterator access
Definition at line 444 of file access_map.h.
Referenced by TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::begin().
|
inline |
const end iterator access
Definition at line 453 of file access_map.h.
Referenced by TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::end().
|
inline |
determines if the item is in this map.
type_to_find | the item to find |
Definition at line 233 of file access_map.h.
|
inline |
determines is the type name exists in this map
type_name | the type name to check |
Definition at line 218 of file access_map.h.
Referenced by TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::contains(), TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::modelChanged(), and TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator==().
|
inline |
determines if the other
is a subset of this map
other | the other map |
Definition at line 248 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::contains().
|
inline |
creates the given item by copy
type_to_add | the item to add |
throws | if a item with that name already exists |
Definition at line 265 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::access(), and TypeValidationInfo< T >::getDifference().
Referenced by TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::add(), and TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::emplace().
|
inline |
creates the given item in place
type_to_add | the item to emplace |
throws | if a item with that name already exists |
Definition at line 322 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::access(), and TypeValidationInfo< T >::getDifference().
|
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 568 of file access_map.h.
|
inline |
emplaces the given item
type_to_add | the item to emplace |
throws | if a item with that name already exists |
Definition at line 368 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::create().
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inline |
|
inline |
range based end operator for const access
Definition at line 471 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::cend().
|
inline |
get the item with the given name type_name
type_name | the item to find |
Definition at line 202 of file access_map.h.
|
inline |
Get the Size.
Definition at line 417 of file access_map.h.
Referenced by TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator==().
|
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 524 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::contains().
|
inline |
non equality operator.
other | the other TypeAccessMap to compare this map to. |
Definition at line 498 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator==().
|
inline |
copies (deepcopy!) and overwrite the current content.
other | the other list |
Definition at line 180 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::clear().
|
inline |
move assignment operator
Definition at line 140 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::clear().
|
inline |
equality operator.
other | the other TypeAccessMap to compare this map to. |
Definition at line 482 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::contains(), and TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::getSize().
Referenced by TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::operator!=().
|
inline |
item to remove
type_name | the item name to remove |
Definition at line 378 of file access_map.h.
References TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::access().