Cogs.Core
ComponentCollection.cpp
1#include "ComponentCollection.h"
2
3#include "ComponentModel/Component.h"
4
5#include <algorithm>
6
7// Defined to make constructor not inline in dynamically linked projects.
9
11{
12 components.push_back(component);
13}
14
16{
17 auto found = std::find_if(components.begin(), components.end(), [&](const ComponentHandle& c) { return c == component; });
18
19 components.erase(found);
20}
21
23{
24 components.clear();
25}
COGSFOUNDATION_API void add(ComponentHandle component)
Adds the given component handle to the collection.
COGSFOUNDATION_API ComponentCollectionBase()
Creates an empty component collection.
COGSFOUNDATION_API void remove(ComponentHandle component)
Removes the given component from the collection.
COGSFOUNDATION_API void clear()
Clears the contents of the collection.
Handle to a Component instance.
Definition: Component.h:67