![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton that caches per-node incoming/outgoing ExecPinConnection lists. More...
#include <LinkCache.h>
Public Member Functions | |
| void | Rebuild (const std::vector< ExecPinConnection > &connections) |
| Rebuilds both outgoing and incoming maps from the supplied list. | |
| void | Invalidate () |
| Marks the cache as stale. | |
| bool | IsValid () const |
| Returns true if the cache has been built and is not stale. | |
| const std::vector< ExecPinConnection > & | GetOutgoing (int nodeId) const |
Returns the list of connections that originate from nodeId. | |
| const std::vector< ExecPinConnection > & | GetIncoming (int nodeId) const |
Returns the list of connections that terminate at nodeId. | |
| int | GetConnectionCount () const |
| Returns the total number of connections stored in the cache. | |
Static Public Member Functions | |
| static LinkCache & | Get () |
| Returns the single shared instance. | |
Private Member Functions | |
| LinkCache () | |
Private Attributes | |
| std::unordered_map< int, std::vector< ExecPinConnection > > | m_Outgoing |
| std::unordered_map< int, std::vector< ExecPinConnection > > | m_Incoming |
| std::vector< ExecPinConnection > | m_EmptyList |
| Returned for misses. | |
| bool | m_IsValid |
| int | m_ConnectionCount |
Singleton that caches per-node incoming/outgoing ExecPinConnection lists.
Typical usage:
Definition at line 43 of file LinkCache.h.
|
private |
Definition at line 22 of file LinkCache.cpp.
|
static |
Returns the single shared instance.
Definition at line 16 of file LinkCache.cpp.
| int Olympe::LinkCache::GetConnectionCount | ( | ) | const |
Returns the total number of connections stored in the cache.
Definition at line 79 of file LinkCache.cpp.
References m_ConnectionCount.
| const std::vector< ExecPinConnection > & Olympe::LinkCache::GetIncoming | ( | int | nodeId | ) | const |
Returns the list of connections that terminate at nodeId.
Returns an empty vector if the node has no incoming connections.
Definition at line 71 of file LinkCache.cpp.
References GetComponentTypeID_Static(), m_EmptyList, and m_Incoming.
Here is the call graph for this function:| const std::vector< ExecPinConnection > & Olympe::LinkCache::GetOutgoing | ( | int | nodeId | ) | const |
Returns the list of connections that originate from nodeId.
Returns an empty vector if the node has no outgoing connections.
Definition at line 63 of file LinkCache.cpp.
References GetComponentTypeID_Static(), m_EmptyList, and m_Outgoing.
Here is the call graph for this function:| void Olympe::LinkCache::Invalidate | ( | ) |
Marks the cache as stale.
The next Rebuild() call refreshes it.
Definition at line 49 of file LinkCache.cpp.
References m_IsValid.
| bool Olympe::LinkCache::IsValid | ( | ) | const |
Returns true if the cache has been built and is not stale.
Definition at line 54 of file LinkCache.cpp.
References m_IsValid.
| void Olympe::LinkCache::Rebuild | ( | const std::vector< ExecPinConnection > & | connections | ) |
Rebuilds both outgoing and incoming maps from the supplied list.
| connections | Flat list of exec-pin connections (e.g. from a TaskGraphTemplate). |
Definition at line 32 of file LinkCache.cpp.
References GetComponentTypeID_Static(), m_ConnectionCount, m_Incoming, m_IsValid, and m_Outgoing.
Here is the call graph for this function:
|
private |
Definition at line 104 of file LinkCache.h.
Referenced by GetConnectionCount(), and Rebuild().
|
private |
Returned for misses.
Definition at line 102 of file LinkCache.h.
Referenced by GetIncoming(), and GetOutgoing().
|
private |
Definition at line 101 of file LinkCache.h.
Referenced by GetIncoming(), and Rebuild().
|
private |
Definition at line 103 of file LinkCache.h.
Referenced by Invalidate(), IsValid(), and Rebuild().
|
private |
Definition at line 100 of file LinkCache.h.
Referenced by GetOutgoing(), and Rebuild().