Ocean
Ocean::Media::MediumRefManager Class Reference

This class implements a medium reference manager. More...

Inheritance diagram for Ocean::Media::MediumRefManager:

Public Member Functions

MediumRef registerMedium (Medium *medium)
 Registers a new medium. More...
 
MediumRef medium (const std::string &url, const std::string &library, const Medium::Type type)
 Returns a medium by a given url. More...
 

Protected Types

typedef std::multimap< std::string, MediumRefMediumMap
 Map mapping urls to medium references. More...
 

Protected Member Functions

 ~MediumRefManager ()
 Destructs the manager. More...
 
MediumRef medium (const std::string &url)
 Returns a medium by a given url. More...
 
MediumRef medium (const std::string &url, const Medium::Type type)
 Returns a medium by a given url. More...
 
bool isRegistered (const Medium *medium)
 Returns whether a medium is registered at this manager. More...
 
void unregisterMedium (const Medium *medium)
 Unregisters a medium. More...
 
- Protected Member Functions inherited from Ocean::Singleton< MediumRefManager >
 Singleton ()=default
 Default constructor. More...
 

Protected Attributes

MediumMap mediumMap
 Map holding all medium references. More...
 
Lock lock
 Lock for the medium map. More...
 

Friends

class Singleton< MediumRefManager >
 
class ObjectRef< Medium >
 
class Medium
 
class Manager
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Singleton< MediumRefManager >
static MediumRefManager & get ()
 Returns a reference to the unique object. More...
 

Detailed Description

This class implements a medium reference manager.

Member Typedef Documentation

◆ MediumMap

typedef std::multimap<std::string, MediumRef> Ocean::Media::MediumRefManager::MediumMap
protected

Map mapping urls to medium references.

Constructor & Destructor Documentation

◆ ~MediumRefManager()

Ocean::Media::MediumRefManager::~MediumRefManager ( )
protected

Destructs the manager.

Member Function Documentation

◆ isRegistered()

bool Ocean::Media::MediumRefManager::isRegistered ( const Medium medium)
protected

Returns whether a medium is registered at this manager.

Parameters
mediumMedium to check
Returns
True, if so

◆ medium() [1/3]

MediumRef Ocean::Media::MediumRefManager::medium ( const std::string &  url)
protected

Returns a medium by a given url.

If the medium does not exist an empty reference is returned.

Parameters
urlUrl of the medium that has to be returned
Returns
Medium reference of the requested url

◆ medium() [2/3]

MediumRef Ocean::Media::MediumRefManager::medium ( const std::string &  url,
const Medium::Type  type 
)
protected

Returns a medium by a given url.

If the medium does not exist an empty reference is returned.

Parameters
urlUrl of the requested medium
typeType of the expected medium
Returns
Medium reference of the requested url

◆ medium() [3/3]

MediumRef Ocean::Media::MediumRefManager::medium ( const std::string &  url,
const std::string &  library,
const Medium::Type  type 
)

Returns a medium by a given url.

If the medium does not exist an empty reference is returned.

Parameters
urlUrl of the new medium
libraryName of the owner library
typeType of the expected medium
Returns
Medium reference of the requested url

◆ registerMedium()

MediumRef Ocean::Media::MediumRefManager::registerMedium ( Medium medium)

Registers a new medium.

Parameters
mediumMedium object to manage
Returns
Medium reference

◆ unregisterMedium()

void Ocean::Media::MediumRefManager::unregisterMedium ( const Medium medium)
protected

Unregisters a medium.

Parameters
mediumMedium to unregister

Friends And Related Function Documentation

◆ Manager

friend class Manager
friend

◆ Medium

friend class Medium
friend

◆ ObjectRef< Medium >

friend class ObjectRef< Medium >
friend

◆ Singleton< MediumRefManager >

friend class Singleton< MediumRefManager >
friend

Field Documentation

◆ lock

Lock Ocean::Media::MediumRefManager::lock
protected

Lock for the medium map.

◆ mediumMap

MediumMap Ocean::Media::MediumRefManager::mediumMap
protected

Map holding all medium references.


The documentation for this class was generated from the following file: