Middle Europe Productions Library  alpha 1.3.3
Public Member Functions | List of all members
MEPtools::GroupManager< X, PtrType, SecondStructure > Class Template Reference

#include <Group.h>

Public Member Functions

 GroupManager ()=default
 
bool _insert (MEP::U_int32 ID, MEP::U_int32 group, PtrType value)
 
X & _get (MEP::U_int32 ID, MEP::U_int32 group) const
 
SecondStructure & _getGroup (MEP::U_int32 group)
 
bool _deleteGroup (MEP::U_int32 group)
 
bool _deleteElement (MEP::U_int32 ID, MEP::U_int32 group)
 
template<typename Method >
void _execute (Method method)
 
template<typename Method >
bool _execute (Method method, MEP::U_int32 group)
 
template<typename Method >
void _execute (Method method) const
 
template<typename Method >
bool _execute (Method method, MEP::U_int32 group) const
 
void _debugOutput (std::ostream &out, const char *before="", const char *after="") const
 
template<typename Out >
void _debugOutput (std::ostream &out, Out method) const
 
unsigned int _size () const
 
bool _empty () const
 
void _clear ()
 

Detailed Description

template<typename X, typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
class MEPtools::GroupManager< X, PtrType, SecondStructure >

A library memory management system is built around this container.

Constructor & Destructor Documentation

◆ GroupManager()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
MEPtools::GroupManager< X, PtrType, SecondStructure >::GroupManager ( )
default

Member Function Documentation

◆ _clear()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
void MEPtools::GroupManager< X, PtrType, SecondStructure >::_clear ( )
inline

Clears the map.

◆ _debugOutput() [1/2]

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
void MEPtools::GroupManager< X, PtrType, SecondStructure >::_debugOutput ( std::ostream &  out,
const char *  before = "",
const char *  after = "" 
) const
inline

Diagnostic tool.

◆ _debugOutput() [2/2]

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
template<typename Out >
void MEPtools::GroupManager< X, PtrType, SecondStructure >::_debugOutput ( std::ostream &  out,
Out  method 
) const
inline

Diagnostic tool.

◆ _deleteElement()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
bool MEPtools::GroupManager< X, PtrType, SecondStructure >::_deleteElement ( MEP::U_int32  ID,
MEP::U_int32  group 
)
inline

Deletes the object.

Returns
: True - object deleted. False - object not found.

◆ _deleteGroup()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
bool MEPtools::GroupManager< X, PtrType, SecondStructure >::_deleteGroup ( MEP::U_int32  group)
inline

Deletes the group of objects.

Returns
: True - group deleted. False - group not found.

◆ _empty()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
bool MEPtools::GroupManager< X, PtrType, SecondStructure >::_empty ( ) const
inline

Is constainer empty.

◆ _execute() [1/4]

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
template<typename Method >
void MEPtools::GroupManager< X, PtrType, SecondStructure >::_execute ( Method  method)
inline

Executes method a for all of the elements.

◆ _execute() [2/4]

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
template<typename Method >
void MEPtools::GroupManager< X, PtrType, SecondStructure >::_execute ( Method  method) const
inline

Executes constant method a for all of the elements.

◆ _execute() [3/4]

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
template<typename Method >
bool MEPtools::GroupManager< X, PtrType, SecondStructure >::_execute ( Method  method,
MEP::U_int32  group 
)
inline

Execute method for a group of objects.

◆ _execute() [4/4]

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
template<typename Method >
bool MEPtools::GroupManager< X, PtrType, SecondStructure >::_execute ( Method  method,
MEP::U_int32  group 
) const
inline

Execute constant method for a group of objects.

◆ _get()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
X& MEPtools::GroupManager< X, PtrType, SecondStructure >::_get ( MEP::U_int32  ID,
MEP::U_int32  group 
) const
inline

Outputs the element.

◆ _getGroup()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
SecondStructure& MEPtools::GroupManager< X, PtrType, SecondStructure >::_getGroup ( MEP::U_int32  group)
inline

Outputs the group of elements.

◆ _insert()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
bool MEPtools::GroupManager< X, PtrType, SecondStructure >::_insert ( MEP::U_int32  ID,
MEP::U_int32  group,
PtrType  value 
)
inline

Insert the element at a given spot. When SecondStructure is a std::set or std::map executes in O(logn + m) else
When SecondStructure is a std::list executes in O(m) Where n is a numer of elements in m-th group, and m is a number of groups.

◆ _size()

template<typename X , typename PtrType = std::unique_ptr<X>, typename SecondStructure = std::map<MEP::U_int32, PtrType>>
unsigned int MEPtools::GroupManager< X, PtrType, SecondStructure >::_size ( ) const
inline

Number of objects.