Kea 2.7.6
|
Holds associations between objects and HA relationships. More...
#include <ha_relationship_mapper.h>
Public Types | |
typedef boost::shared_ptr< MappedType > | MappedTypePtr |
A pointer to the held object type. | |
Public Member Functions | |
MappedTypePtr | get () const |
Returns the default mapped object. | |
MappedTypePtr | get (const std::string &key) const |
Retrieves mapped object by a key (e.g., partner name). | |
const std::vector< MappedTypePtr > & | getAll () const |
Returns all mapped objects. | |
bool | hasMultiple () const |
Checks if the mapper has multiple objects. | |
void | map (const std::string &key, MappedTypePtr obj) |
Associates a key with the object. | |
Holds associations between objects and HA relationships.
There are at least two classes that require associations with the HA relationships: HAService
and HAConfig
. The HAImpl
class may hold one or more instances of these classes. The library must be able to select appropriate instances depending on the partner name. This class associates partners with the relationships. Each partner may be associated with only one relationship. One relationship may be associated with many partners (e.g., primary and standby).
Definition at line 33 of file ha_relationship_mapper.h.
boost::shared_ptr<MappedType> isc::ha::HARelationshipMapper< MappedType >::MappedTypePtr |
A pointer to the held object type.
Definition at line 37 of file ha_relationship_mapper.h.
|
inline |
Returns the default mapped object.
InvalidOperation | when there is no mapped object. |
Definition at line 77 of file ha_relationship_mapper.h.
References isc_throw.
|
inline |
Retrieves mapped object by a key (e.g., partner name).
key | typically a name of the partner belonging to a relationship. |
Definition at line 65 of file ha_relationship_mapper.h.
|
inline |
Returns all mapped objects.
Definition at line 87 of file ha_relationship_mapper.h.
|
inline |
Checks if the mapper has multiple objects.
Definition at line 95 of file ha_relationship_mapper.h.
|
inline |
Associates a key with the object.
key | typically a name of a partner belonging to a relationship. |
obj | mapped object. |
Definition at line 43 of file ha_relationship_mapper.h.
References isc_throw.