degate  0.1.2
Public Member Functions | Protected Attributes
degate::StoragePolicy_File< PixelPolicy > Class Template Reference

Storage policy for image objects that are stored in a file. More...

#include <StoragePolicies.h>

Inheritance diagram for degate::StoragePolicy_File< PixelPolicy >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 StoragePolicy_File (unsigned int _width, unsigned int _height, std::string const &filename, bool persistent=false)
virtual ~StoragePolicy_File ()
PixelPolicy::pixel_type get_pixel (unsigned int x, unsigned int y) const
 Get pixel for "native" pixel types.
void set_pixel (unsigned int x, unsigned int y, typename PixelPolicy::pixel_type new_val)
 Set "native" pixel.

Protected Attributes

MemoryMap< typename
PixelPolicy::pixel_type > 
memory_map

Detailed Description

template<class PixelPolicy>
class degate::StoragePolicy_File< PixelPolicy >

Storage policy for image objects that are stored in a file.

Definition at line 110 of file StoragePolicies.h.


Constructor & Destructor Documentation

template<class PixelPolicy >
degate::StoragePolicy_File< PixelPolicy >::StoragePolicy_File ( unsigned int  _width,
unsigned int  _height,
std::string const &  filename,
bool  persistent = false 
) [inline]

Definition at line 118 of file StoragePolicies.h.

                                                :
      memory_map(_width, _height,
                 persistent == false ? MAP_STORAGE_TYPE_TEMP_FILE : MAP_STORAGE_TYPE_PERSISTENT_FILE,
                 filename) {
    }
template<class PixelPolicy >
virtual degate::StoragePolicy_File< PixelPolicy >::~StoragePolicy_File ( ) [inline, virtual]

Definition at line 127 of file StoragePolicies.h.

{}

Member Function Documentation

template<class PixelPolicy >
PixelPolicy::pixel_type degate::StoragePolicy_File< PixelPolicy >::get_pixel ( unsigned int  x,
unsigned int  y 
) const [inline, virtual]

Get pixel for "native" pixel types.

This method is abstract. If you derive from this class, you should implement it for a concrete StoragePolicy.

Implements degate::StoragePolicy_Base< PixelPolicy >.

Definition at line 129 of file StoragePolicies.h.

References degate::MemoryMap< T >::get(), and degate::StoragePolicy_File< PixelPolicy >::memory_map.

                                                                             {
      return memory_map.get(x, y);
    }

Here is the call graph for this function:

template<class PixelPolicy >
void degate::StoragePolicy_File< PixelPolicy >::set_pixel ( unsigned int  x,
unsigned int  y,
typename PixelPolicy::pixel_type  new_val 
) [inline, virtual]

Set "native" pixel.

This method is abstract. If you derive from this class, you should implement it for a concrete StoragePolicy.

Implements degate::StoragePolicy_Base< PixelPolicy >.

Definition at line 134 of file StoragePolicies.h.

References degate::StoragePolicy_File< PixelPolicy >::memory_map, and degate::MemoryMap< T >::set().

                                                                  {
      memory_map.set(x, y, new_val);
    }

Here is the call graph for this function:


Member Data Documentation

template<class PixelPolicy >
MemoryMap<typename PixelPolicy::pixel_type> degate::StoragePolicy_File< PixelPolicy >::memory_map [protected]

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