![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton cache mapping connection IDs to Bezier control points. More...
#include <ConnectionCache.h>
Collaboration diagram for Olympe::ConnectionCache:Public Member Functions | |
| bool | HasCached (int connectionId) const |
Returns true if Bezier points are stored for connectionId. | |
| const BezierPoints & | GetBezier (int connectionId) const |
Returns the cached Bezier points for connectionId. | |
| void | SetBezier (int connectionId, const BezierPoints &pts) |
Stores or overwrites the Bezier points for connectionId. | |
| void | Invalidate (int connectionId) |
Removes the cached entry for connectionId. | |
| void | InvalidateAll () |
| Clears all cached entries. | |
| size_t | GetCacheSize () const |
| Returns the number of entries currently in the cache. | |
Static Public Member Functions | |
| static ConnectionCache & | Get () |
| Returns the single shared instance. | |
Private Member Functions | |
| ConnectionCache () | |
Private Attributes | |
| std::map< int, BezierPoints > | m_Cache |
| BezierPoints | m_DefaultBezier |
| Returned when ID is not in cache. | |
Singleton cache mapping connection IDs to Bezier control points.
Typical usage:
Definition at line 58 of file ConnectionCache.h.
|
private |
Definition at line 28 of file ConnectionCache.cpp.
References m_DefaultBezier.
|
static |
Returns the single shared instance.
Definition at line 18 of file ConnectionCache.cpp.
| const BezierPoints & Olympe::ConnectionCache::GetBezier | ( | int | connectionId | ) | const |
Returns the cached Bezier points for connectionId.
Returns a default (zero-initialised) BezierPoints if not cached.
Definition at line 42 of file ConnectionCache.cpp.
References GetComponentTypeID_Static(), m_Cache, and m_DefaultBezier.
Here is the call graph for this function:| size_t Olympe::ConnectionCache::GetCacheSize | ( | ) | const |
Returns the number of entries currently in the cache.
Definition at line 65 of file ConnectionCache.cpp.
References m_Cache.
Returns true if Bezier points are stored for connectionId.
Definition at line 37 of file ConnectionCache.cpp.
References GetComponentTypeID_Static(), and m_Cache.
Here is the call graph for this function:Removes the cached entry for connectionId.
Definition at line 55 of file ConnectionCache.cpp.
References GetComponentTypeID_Static(), and m_Cache.
Here is the call graph for this function:| void Olympe::ConnectionCache::InvalidateAll | ( | ) |
| void Olympe::ConnectionCache::SetBezier | ( | int | connectionId, |
| const BezierPoints & | pts | ||
| ) |
Stores or overwrites the Bezier points for connectionId.
Definition at line 50 of file ConnectionCache.cpp.
References GetComponentTypeID_Static(), and m_Cache.
Here is the call graph for this function:
|
private |
Definition at line 109 of file ConnectionCache.h.
Referenced by GetBezier(), GetCacheSize(), HasCached(), Invalidate(), InvalidateAll(), and SetBezier().
|
private |
Returned when ID is not in cache.
Definition at line 110 of file ConnectionCache.h.
Referenced by ConnectionCache(), and GetBezier().