A repository for a set of Pin model objects.
More...
#include <PinRepository.h>
A repository for a set of Pin model objects.
PinRepository contains an observable set of Pin model objects. It is observable in the sense that external objects can be registered to receive notifications when Pins are added or removed from the repository.
Eegeo::Pins::PinRepository::PinRepository |
( |
| ) |
|
Eegeo::Pins::PinRepository::~PinRepository |
( |
| ) |
|
void Eegeo::Pins::PinRepository::AddPin |
( |
Pin & |
pPinToAdd | ) |
|
Add a Pin to the respository, notifying any observers as appropriate. Asserts if the Pin is already in the repository. Asserts if the another Pin in the repository has the same ID as the one being added.
- Parameters
-
pPinToAdd | A pointer to the Pin object to add to the repository. |
void Eegeo::Pins::PinRepository::AddPinObserver |
( |
IPinObserver & |
observerToAdd | ) |
|
|
virtual |
Register an observer to recieve notifications when the repository contents are modified. Registered observers are notified whenever a Pin is added or removed from the repository.
- Parameters
-
observerToAdd | The observer to register for notifications. |
Implements Eegeo::Pins::IPinObservable.
int Eegeo::Pins::PinRepository::GetNumOfPins |
( |
| ) |
const |
Get the number of Pin objects currently in the repository.
- Returns
- The number of Pin objects in the repository.
Pin * Eegeo::Pins::PinRepository::GetPinAtIndex |
( |
int |
pinIndex | ) |
const |
Get the Pin at particular index within the repository.
- Parameters
-
pinIndex | A zero based index of the Pin to retrieve from the repository. |
- Returns
- A pointer to the Pin at the given index, NULL if the index is out of range.
Pin * Eegeo::Pins::PinRepository::GetPinById |
( |
TPinId |
id | ) |
const |
Find a Pin in repository with a given Id.
- Parameters
-
id | The id of the Pin to find in the repository. |
- Returns
- A pointer to the Pin with the given ID or NULL if no Pin could be found with that ID.
void Eegeo::Pins::PinRepository::RemovePin |
( |
Pin & |
pPinToRemove | ) |
|
Remove a Pin from the repository, notifying any observers as appropriate. Asserts if the Pin couldn't be found in the repository.
- Parameters
-
pPinToRemove | A pointer to the Pin object to remove to the repository. |
void Eegeo::Pins::PinRepository::RemovePinObserver |
( |
IPinObserver & |
observerToRemove | ) |
|
|
virtual |
De-register an observer from the repository. Once an observer is de-registered it will no longer receive notifications when the repository contents are changed.
- Parameters
-
observerToRemove | The observer to de-register from receiving notifications. |
Implements Eegeo::Pins::IPinObservable.
The documentation for this class was generated from the following files: