#pragma once #include "V8Tree/Service.h" #include namespace RBX { extern const char* const sCollectionService; class CollectionService : public DescribedNonCreatable , public Service { public: CollectionService(); rbx::signal)> itemAddedSignal; rbx::signal)> itemRemovedSignal; shared_ptr getCollection(std::string type); shared_ptr getCollection(const Name& className); template shared_ptr getCollection() { return getCollection(T::classDescriptor()); } void removeInstance(shared_ptr instance); void addInstance(shared_ptr instance); private: // TODO: Lookup by const RBX::Name* typedef std::map > > CollectionMap; CollectionMap collections; }; }