DVInstanceCache Class Reference

A class to handle an instance cache (list of items). More...

List of all members.

Public Member Functions

 DVInstanceCache ()
 Constructor.
virtual ~DVInstanceCache ()
 Destructor.
void clear ()
 reset all member variables to initial state.
OFBool empty () const
 checks whether instance cache is empty
Uint32 getCount () const
 gets number of cache entries
OFBool gotoItem (Uint32 idx)
 sets internal cursor to specified position in cache list
OFBool gotoFirst ()
 sets internal cursor to first position in cache list
OFBool gotoNext ()
 sets internal cursor to next position in cache list
OFBool reset ()
 sets internal cursor to last visited position in cache list
OFBool isElem (const OFString &uid)
 checks whether an item with the specified UID exists in the cache list
int getPos () const
 gets the file position of the current (selected) instance
DVIFhierarchyStatus getStatus () const
 gets review status of the current (selected) instance
DVPSInstanceType getType () const
 gets type of the instance
int getImageSize () const
 gets image size of current (selected) instance
const char * getFilename () const
 gets filename of current (selected) instance
ItemStructgetItem () const
 gets reference to current (selected) instance
void addItem (const OFString &uid, const int pos, const DVIFhierarchyStatus status, const DVPSInstanceType type, const int size, const OFString &filename)
 adds a new item to the cache list.
DVIFhierarchyStatus updateStatus ()
 updates hierarchical/review status for all list items.

Protected Member Functions

 OFListIterator (ItemStruct *) Iterator
 internal cursor to current (selected) list item
 OFListIterator (ItemStruct *) OldIterator
 last visited position in item list

Protected Attributes

OFList< ItemStruct * > List
 list of instances

Classes

struct  ItemStruct
 Internal structure defining the list items. More...


Detailed Description

A class to handle an instance cache (list of items).

This is the lowest level in the hierarchical cache structure. Images are handled as well as presentation states. This class is used by DVSeriesCache.

Definition at line 74 of file dvcache.h.


Member Function Documentation

void DVInstanceCache::addItem const OFString uid,
const int  pos,
const DVIFhierarchyStatus  status,
const DVPSInstanceType  type,
const int  size,
const OFString filename
[inline]
 

adds a new item to the cache list.

sets internal cursor to new position.

Parameters:
uid unique identifier
pos file position in index file
status review status
type type of instance
size image size (in bytes)
filename filename of instance

Definition at line 345 of file dvcache.h.

References OFList< T >::end(), List, and OFList< T >::push_back().

void DVInstanceCache::clear  )  [inline]
 

reset all member variables to initial state.

delete all list items.

Definition at line 153 of file dvcache.h.

References OFList< T >::begin(), OFList< T >::clear(), OFList< T >::end(), OFList< T >::erase(), List, and OFListIterator().

Referenced by ~DVInstanceCache(), DVSeriesCache::~DVSeriesCache(), and DVStudyCache::~DVStudyCache().

OFBool DVInstanceCache::empty void   )  const [inline]
 

checks whether instance cache is empty

Returns:
OFTrue if cache is empty, OFFalse otherwise

Definition at line 170 of file dvcache.h.

References OFList< T >::empty(), and List.

Uint32 DVInstanceCache::getCount  )  const [inline]
 

gets number of cache entries

Returns:
number of cache entries

Definition at line 179 of file dvcache.h.

References List, and OFList< T >::size().

const char* DVInstanceCache::getFilename  )  const [inline]
 

gets filename of current (selected) instance

Returns:
filename if successful, NULL otherwise

Definition at line 320 of file dvcache.h.

References OFString::c_str(), DVInstanceCache::ItemStruct::Filename, and getItem().

int DVInstanceCache::getImageSize  )  const [inline]
 

gets image size of current (selected) instance

Returns:
image size in bytes if successful, 0 otherwise

Definition at line 310 of file dvcache.h.

References getItem(), and DVInstanceCache::ItemStruct::ImageSize.

ItemStruct* DVInstanceCache::getItem  )  const [inline]
 

gets reference to current (selected) instance

Returns:
pointer to ItemStruct if successful, NULL otherwise

Definition at line 330 of file dvcache.h.

References OFList< T >::end(), and List.

Referenced by getFilename(), getImageSize(), getPos(), DVStudyCache::getStatus(), DVSeriesCache::getStatus(), getStatus(), DVSeriesCache::getType(), and getType().

int DVInstanceCache::getPos  )  const [inline]
 

gets the file position of the current (selected) instance

Returns:
file position if successful, 0 otherwise

Definition at line 280 of file dvcache.h.

References getItem(), and DVInstanceCache::ItemStruct::Pos.

DVIFhierarchyStatus DVInstanceCache::getStatus  )  const [inline]
 

gets review status of the current (selected) instance

Returns:
hierarchical status code if successful, 'isNew' otherwise

Definition at line 290 of file dvcache.h.

References getItem(), and DVInstanceCache::ItemStruct::Status.

DVPSInstanceType DVInstanceCache::getType  )  const [inline]
 

gets type of the instance

Returns:
type of instance

Definition at line 300 of file dvcache.h.

References getItem(), and DVInstanceCache::ItemStruct::Type.

OFBool DVInstanceCache::gotoFirst  )  [inline]
 

sets internal cursor to first position in cache list

Returns:
OFTrue if successful, OFFalse if list is empty

Definition at line 212 of file dvcache.h.

References OFList< T >::begin(), OFList< T >::end(), and List.

OFBool DVInstanceCache::gotoItem Uint32  idx  )  [inline]
 

sets internal cursor to specified position in cache list

Parameters:
idx index position in cache list (starting with 0)
Returns:
OFTrue if successful, OFFalse if 'idx' is invalid

Definition at line 190 of file dvcache.h.

References OFList< T >::begin(), OFList< T >::end(), List, and OFListIterator().

OFBool DVInstanceCache::gotoNext  )  [inline]
 

sets internal cursor to next position in cache list

Returns:
OFTrue if successful, OFFalse if new position is invalid

Definition at line 223 of file dvcache.h.

References OFList< T >::end(), List, and OFListIterator().

OFBool DVInstanceCache::isElem const OFString uid  )  [inline]
 

checks whether an item with the specified UID exists in the cache list

Parameters:
uid UID which should be checked
Returns:
OFTrue if such an item exists, OFFalse otherwise

Definition at line 255 of file dvcache.h.

References OFList< T >::begin(), OFList< T >::end(), List, OFListIterator(), and DVInstanceCache::ItemStruct::UID.

OFBool DVInstanceCache::reset  )  [inline]
 

sets internal cursor to last visited position in cache list

Returns:
OFTrue if successful, OFFalse if last visited position was invalid or the last one in the list

Definition at line 236 of file dvcache.h.

References OFList< T >::end(), List, and OFListIterator().

DVIFhierarchyStatus DVInstanceCache::updateStatus  )  [inline]
 

updates hierarchical/review status for all list items.

Returns:
resulting review status (summary of all items)

Definition at line 361 of file dvcache.h.

References OFList< T >::begin(), OFList< T >::end(), List, OFListIterator(), and DVInstanceCache::ItemStruct::Status.

Referenced by DVSeriesCache::updateStatus().


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


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5