Template Class InfoObjectRegistry

Class Documentation

template<typename BaseInfoType>
class InfoObjectRegistry

Provides facilities for registering and retrieving info objects.

Note

The BaseInfoType must derive from Convertible<>

Param <BaseInfoType>

The base type of the info objects this InfoObjectRegistry<> is able to register

Public Functions

InfoObjectRegistry() = default

Constructs an instance of InfoObjectRegistry<>

template<typename InfoType>
inline std::pair<InfoType*, bool> RegisterObject(InfoType const &infoObj)

Registers a given InfoType object.

Parameters
  • <InfoType> -- The type of InfoType object to regsiter

  • infoObj -- [in] The InfoType object to register

Returns

An std::pair<> consisting of a pointer to the registered InfoType object and a value indicating whether or not a new registration occured

template<typename InfoType>
inline InfoType const *GetRegisteredObject(InfoType const &infoObj) const

Gets a pointer to a registered InfoType object.

Parameters
  • <DerivedType> -- The type of InfoType object to get the registered pointer for

  • resourceInfo -- [in] The InfoType object to get the registered pointer for

template<typename InfoType>
inline InfoType *GetRegisteredObject(InfoType const &infoObj)

Gets a pointer to a registered InfoType object.

Parameters
  • <DerivedType> -- The type of InfoType object to get the registered pointer for

  • resourceInfo -- [in] The InfoType object to get the registered pointer for

inline void GetRegisteredObjects(size_t *pInfoObjCount, BaseInfoType const **ppInfoObjs) const

Gets all registered InfoType objects.

Note

If pInfoObjCount is nullptr this argument will be populated with this InfoObjectRegistry's total number of registered InfoType objects

Note

If pInfoObjCount is not nullptr this argument will be used to determine the number of InfoType object pointers to write to ppInfoObjs

Parameters
  • pInfoObjCount -- [inout] A pointer to the number of registered InfoType objects

  • ppInfoObjs -- [out] A pointer to an array of InfoType pointers to populate

template<typename InfoType>
inline void GetRegisteredObjectsOfType(size_t *pInfoObjCount, InfoType const **ppInfoObjs) const

Gets all of the registered InfoType objects of a given type.

Note

If ppInfoObjs is nullptr this argument will be populated with this ResourceInfoCollection's total number of registered InfoType objects of the given type

Note

If ppInfoObjs is not nullptr this argument will be used to determine the number of InfoType object pointers to write to ppInfoObjs

Parameters
  • <InfoType> -- The type of registered InfoType objects to get

  • pInfoObjCount -- [inout] A pointer to the number of registered InfoType objects of the given type

  • ppInfoObjs -- [out] A pointer to an array of T pointers to populate