Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

eformat::PagedMemory< TMAXPAGES > Class Template Reference

#include <PagedMemory.h>

List of all members.

Public Types

typedef eformat::PagedMemory::node_t node_t
typedef eformat::PagedMemory::node_t node_t

Public Member Functions

const_iterator begin (void) const
const_iterator begin (void) const
size_t count (void) const
size_t count (void) const
const_iterator end (void) const
const_iterator end (void) const
 PagedMemory (const struct iovec *pages, size_t count)
 PagedMemory (const struct iovec *pages, size_t count)
const struct iovec * pages (void) const
const struct iovec * pages (void) const
size_t size (void) const
size_t size (void) const

Static Public Attributes

const unsigned int MAXPAGES = TMAXPAGES

Private Attributes

size_t m_count
 how many pages do I have in the list above
const struct iovec * m_iovec
 my iovec set of pages
const struct iovec * m_iovec
 my iovec set of pages
node_t m_node [TMAXPAGES]
 index
size_t m_size
 the number of words I have in this Memory


Detailed Description

template<unsigned int TMAXPAGES = 128>
class eformat::PagedMemory< TMAXPAGES >

A list of nodes. To gain speed, the PagedMemory uses an internal page index. The default maximum size of this index is 128. The user can instanciate bigger PagedMemory objects by increasing the default template parameter size to a more suitable value.

Attention: PagedMemory's with different index sizes cannot interact directly.


Member Typedef Documentation

template<unsigned int TMAXPAGES = 128>
typedef struct eformat::PagedMemory::node_t eformat::PagedMemory< TMAXPAGES >::node_t
 

Define a private type that is used to index the access to this type of eformat::Memory. The performance of this iterator is dependent on the distance from the current offset and on the page sizes. Try to use the iterator for small scale reach and readjust if necessary.

template<unsigned int TMAXPAGES = 128>
typedef struct eformat::PagedMemory::node_t eformat::PagedMemory< TMAXPAGES >::node_t
 

Define a private type that is used to index the access to this type of eformat::Memory. The performance of this iterator is dependent on the distance from the current offset and on the page sizes. Try to use the iterator for small scale reach and readjust if necessary.


Constructor & Destructor Documentation

template<unsigned int TMAXPAGES>
eformat::PagedMemory< TMAXPAGES >::PagedMemory< TMAXPAGES > const struct iovec *  pages,
size_t  count
 

Simpler constructor: starts from an existing set of base addresses and sizes. Please note that for reasons of simplicity, the data in all memory blocks have to be 32-bit aligned. Otherwise, the implementation should be DC::Buffer, where this has all been thought about.

Also note that this class is intended for reading data and optimized for such. If you just want to manipulate fragments you are better doing it your self or using the writing part of the library.

Parameters:
pages The memory area I would like to read data from
count The number of pages pointed by the variable pages. This has to be smaller than TMAXPAGES.

template<unsigned int TMAXPAGES = 128>
eformat::PagedMemory< TMAXPAGES >::PagedMemory const struct iovec *  pages,
size_t  count
 

Simpler constructor: starts from an existing set of base addresses and sizes. Please note that for reasons of simplicity, the data in all memory blocks have to be 32-bit aligned. Otherwise, the implementation should be DC::Buffer, where this has all been thought about.

Also note that this class is intended for reading data and optimized for such. If you just want to manipulate fragments you are better doing it your self or using the writing part of the library.

Parameters:
pages The memory area I would like to read data from
count The number of pages pointed by the variable pages. This has to be smaller than TMAXPAGES.


Member Function Documentation

template<unsigned int TMAXPAGES = 128>
const_iterator eformat::PagedMemory< TMAXPAGES >::begin void   )  const [inline]
 

Returns a const iterator to the begin of this list

Parameters:
it An updateable iterator you should provide.
00250     { return const_iterator(m_node, 0); }

template<unsigned int TMAXPAGES = 128>
const_iterator eformat::PagedMemory< TMAXPAGES >::begin void   )  const [inline]
 

Returns a const iterator to the begin of this list

Parameters:
it An updateable iterator you should provide.
00250     { return const_iterator(m_node, 0); }

template<unsigned int TMAXPAGES = 128>
size_t eformat::PagedMemory< TMAXPAGES >::count void   )  const [inline]
 

Returns the number of blocks in this IO vector

00071 { return m_count; }

template<unsigned int TMAXPAGES = 128>
size_t eformat::PagedMemory< TMAXPAGES >::count void   )  const [inline]
 

Returns the number of blocks in this IO vector

00071 { return m_count; }

template<unsigned int TMAXPAGES = 128>
const_iterator eformat::PagedMemory< TMAXPAGES >::end void   )  const [inline]
 

Returns a const iterator to the end of this list

Parameters:
it An updateable iterator you should provide.
00258     { return const_iterator(&m_node[m_count], m_size); }

template<unsigned int TMAXPAGES = 128>
const_iterator eformat::PagedMemory< TMAXPAGES >::end void   )  const [inline]
 

Returns a const iterator to the end of this list

Parameters:
it An updateable iterator you should provide.
00258     { return const_iterator(&m_node[m_count], m_size); }

template<unsigned int TMAXPAGES = 128>
const struct iovec* eformat::PagedMemory< TMAXPAGES >::pages void   )  const [inline]
 

Returns the base address of the input IO vector

00066 { return m_iovec; }

template<unsigned int TMAXPAGES = 128>
const struct iovec* eformat::PagedMemory< TMAXPAGES >::pages void   )  const [inline]
 

Returns the base address of the input IO vector

00066 { return m_iovec; }

template<unsigned int TMAXPAGES = 128>
size_t eformat::PagedMemory< TMAXPAGES >::size void   )  const [inline]
 

Returns the size in bytes words for this PagedMemory.

00076 { return m_size; }

template<unsigned int TMAXPAGES = 128>
size_t eformat::PagedMemory< TMAXPAGES >::size void   )  const [inline]
 

Returns the size in bytes words for this PagedMemory.

00076 { return m_size; }


Member Data Documentation

template<unsigned int TMAXPAGES = 128>
size_t eformat::PagedMemory< TMAXPAGES >::m_count [private]
 

how many pages do I have in the list above

template<unsigned int TMAXPAGES = 128>
const struct iovec* eformat::PagedMemory< TMAXPAGES >::m_iovec [private]
 

my iovec set of pages

template<unsigned int TMAXPAGES = 128>
const struct iovec* eformat::PagedMemory< TMAXPAGES >::m_iovec [private]
 

my iovec set of pages

template<unsigned int TMAXPAGES = 128>
node_t eformat::PagedMemory< TMAXPAGES >::m_node [private]
 

index

template<unsigned int TMAXPAGES = 128>
size_t eformat::PagedMemory< TMAXPAGES >::m_size [private]
 

the number of words I have in this Memory

template<unsigned int TMAXPAGES = 128>
const unsigned int eformat::PagedMemory< TMAXPAGES >::MAXPAGES = TMAXPAGES [static]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 19:18:04 2011 for BOSS6.5.5 by  doxygen 1.3.9.1