3 #include "EegeoShapes.h"
5 #include "ModelRepository.h"
12 typename ShapeModelRepositoryType,
13 typename ShapeModelAddedEventType,
14 typename ShapeModelRemovedEventType
20 ShapeModelAddedEventType& shapeModelAddedEvent,
21 ShapeModelRemovedEventType& shapeModelRemovedEvent)
22 : m_shapeModelRepository(shapeModelRepository)
23 , m_shapeModelAddedEvent(shapeModelAddedEvent)
24 , m_shapeModelRemovedEvent(shapeModelRemovedEvent)
26 m_shapeModelRepository.AddObserver(*
this);
31 m_shapeModelRepository.RemoveObserver(*
this);
34 virtual void OnItemAdded(
const typename ShapeModelRepositoryType::ItemType& item)
36 m_shapeModelAddedEvent.Raise(*item);
39 virtual void OnItemRemoved(
const typename ShapeModelRepositoryType::ItemType& item)
41 m_shapeModelRemovedEvent.Raise(*item);
45 ShapeModelRepositoryType& m_shapeModelRepository;
46 ShapeModelAddedEventType& m_shapeModelAddedEvent;
47 ShapeModelRemovedEventType& m_shapeModelRemovedEvent;