ESA JPIP server  0.1
jpeg2000::IndexManager Class Reference

Manages the indexing information of a repository fo images. More...

#include <index_manager.h>

Collaboration diagram for jpeg2000::IndexManager:

Public Member Functions

 IndexManager ()
 Empty constructor. More...
 
bool Init (string root_dir, string cache_dir)
 Initializes the object. More...
 
ImageIndex::Ptr GetBegin ()
 Returns a pointer to the first image index. More...
 
ImageIndex::Ptr GetEnd ()
 Returns a pointer to the last image index. More...
 
FileManagerfile_manager ()
 Returns a reference to the base file manager. More...
 
bool OpenImage (string &path_image_file, ImageIndex::Ptr *image_index)
 Opens an image and adds its index to the list. More...
 
bool CloseImage (const ImageIndex::Ptr &image_index)
 Closes an image and removes its index from the list, only if it is not used by any other one. More...
 
int GetSize () const
 Returns the size of the list. More...
 
virtual ~IndexManager ()
 

Private Member Functions

bool UnsafeOpenImage (string &path_image_file, ImageIndex::Ptr *image_index)
 Unsafely (without mutex) opens an image and adds its index to the list. More...
 
bool UnsafeCloseImage (const ImageIndex::Ptr &image_index)
 Unsafely (without mutex) closes an image and removes its index from the list, only if it is not used by any other one. More...
 

Private Attributes

Mutex mutex
 Mutex for the operations with the list. More...
 
FileManager file_manager_
 File manager. More...
 
list< ImageIndexindex_list
 List of the indexes. More...
 

Detailed Description

Manages the indexing information of a repository fo images.

Maintains a list in memory of the indexes (using the class ImageIndex for the nodes) of all the opened images and allows a multi-thread access to the information.

See also
FileManager
ImageIndex

Constructor & Destructor Documentation

jpeg2000::IndexManager::IndexManager ( )
inline

Empty constructor.

virtual jpeg2000::IndexManager::~IndexManager ( )
inlinevirtual

Member Function Documentation

bool jpeg2000::IndexManager::CloseImage ( const ImageIndex::Ptr image_index)

Closes an image and removes its index from the list, only if it is not used by any other one.

Parameters
image_indexAssociated image index.
Returns
true if successful.

Here is the caller graph for this function:

FileManager& jpeg2000::IndexManager::file_manager ( )
inline

Returns a reference to the base file manager.

Here is the caller graph for this function:

ImageIndex::Ptr jpeg2000::IndexManager::GetBegin ( )
inline

Returns a pointer to the first image index.

Here is the caller graph for this function:

ImageIndex::Ptr jpeg2000::IndexManager::GetEnd ( )
inline

Returns a pointer to the last image index.

Here is the caller graph for this function:

int jpeg2000::IndexManager::GetSize ( ) const
inline

Returns the size of the list.

Here is the caller graph for this function:

bool jpeg2000::IndexManager::Init ( string  root_dir,
string  cache_dir 
)
inline

Initializes the object.

Parameters
root_dirRoot directory of the image repository.
cache_dirDirectory used for caching.
Returns
true if successful

Here is the caller graph for this function:

bool jpeg2000::IndexManager::OpenImage ( string &  path_image_file,
ImageIndex::Ptr image_index 
)

Opens an image and adds its index to the list.

Parameters
path_image_filePath of the image file.
image_indexReceives the pointer to the image index created.
Returns
true if successful.

Here is the caller graph for this function:

bool jpeg2000::IndexManager::UnsafeCloseImage ( const ImageIndex::Ptr image_index)
private

Unsafely (without mutex) closes an image and removes its index from the list, only if it is not used by any other one.

Parameters
image_indexAssociated image index.
Returns
true if successful.
bool jpeg2000::IndexManager::UnsafeOpenImage ( string &  path_image_file,
ImageIndex::Ptr image_index 
)
private

Unsafely (without mutex) opens an image and adds its index to the list.

Parameters
path_image_filePath of the image file.
image_indexReceives the pointer to the image index created.
Returns
true if successful.

Here is the call graph for this function:

Member Data Documentation

FileManager jpeg2000::IndexManager::file_manager_
private

File manager.

list<ImageIndex> jpeg2000::IndexManager::index_list
private

List of the indexes.

Mutex jpeg2000::IndexManager::mutex
private

Mutex for the operations with the list.


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