All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
Eegeo::Pins::PinRepository Class Reference

A repository for a set of Pin model objects. More...

#include <PinRepository.h>

Inheritance diagram for Eegeo::Pins::PinRepository:
Eegeo::Pins::IPinObservable

Public Member Functions

 PinRepository ()
 
 ~PinRepository ()
 
void AddPin (Pin &pPinToAdd)
 
void RemovePin (Pin &pPinToRemove)
 
int GetNumOfPins () const
 
PinGetPinAtIndex (int pinIndex) const
 
PinGetPinById (TPinId id) const
 
virtual void AddPinObserver (IPinObserver &observerToAdd)
 
virtual void RemovePinObserver (IPinObserver &observerToRemove)
 

Detailed Description

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.

Constructor & Destructor Documentation

Eegeo::Pins::PinRepository::PinRepository ( )

Create an empty PinRepository

Returns
An empty PinRepository object
Eegeo::Pins::PinRepository::~PinRepository ( )

Destroy a PinRepository and all of the Pin objects it contains.

Member Function Documentation

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
pPinToAddA 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
observerToAddThe 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
pinIndexA 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
idThe 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
pPinToRemoveA 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
observerToRemoveThe observer to de-register from receiving notifications.

Implements Eegeo::Pins::IPinObservable.


The documentation for this class was generated from the following files: