eformat::write Namespace Reference


Classes

class  FullEventFragment
struct  node_t
class  ROBFragment
 forward More...
class  ROSFragment
 forward More...
class  SubDetectorFragment
 forward More...

Typedefs

typedef eformat::write::node_t node_t

Functions

void set (node_t &i, const uint32_t *b, size_t l, node_t *n=0)
void set (node_t &i, const struct iovec &v, node_t *n=0)
void cat (node_t *n, const struct iovec *v, uint32_t count)
void cat (node_t *n, uint32_t count)
uint32_t count (const node_t &list)
uint32_t count_words (const node_t &list)
uint32_t copy (const node_t &list, uint32_t *dest, size_t max)
uint32_t shallow_copy (const node_t &list, struct iovec *dest, uint32_t max)
void set (node_t &i, const uint32_t *b, size_t l, node_t *n)
void set (node_t &i, const struct iovec &v, node_t *n)
void cat (node_t *n, const struct iovec *v, uint32_t count)
void cat (node_t *n, uint32_t count)
uint32_t count (const node_t &list)
uint32_t count_words (const node_t &list)
uint32_t copy (const node_t &list, uint32_t *dest, size_t max)
uint32_t shallow_copy (const node_t &list, struct iovec *dest, uint32_t max)


Typedef Documentation

typedef struct eformat::write::node_t eformat::write::node_t

Defines what is a valid "I/O vector" (a.k.a. iov) node list for eformat


Function Documentation

void eformat::write::set ( node_t i,
const uint32_t *  b,
size_t  l,
node_t n = 0 
)

Sets an IOV base values

Parameters:
i the node to be set
b the base address to be used by this IOV
l the size of the page, in words
n the next node this node should point to

Definition at line 16 of file node.cxx.

Referenced by rdbModel::InterRow::addSet(), cat(), eformat::write::FullEventFragment::FullEventFragment(), eformat::write::SubDetectorFragment::operator=(), eformat::write::ROSFragment::operator=(), eformat::write::ROBFragment::operator=(), eformat::write::FullEventFragment::operator=(), EvtGenKine::PhaseSpace(), RecMucTrack::RecMucTrack(), eformat::write::ROBFragment::ROBFragment(), eformat::write::ROSFragment::ROSFragment(), and eformat::write::SubDetectorFragment::SubDetectorFragment().

00017 { 
00018   i.base = const_cast<uint32_t*>(b); 
00019   i.size_word = l; 
00020   i.next = n;
00021 }

void eformat::write::set ( node_t i,
const struct iovec &  v,
node_t n = 0 
)

Sets an IOV base values

Parameters:
i the node to be set
v the I/O vector node to use as basis
n the next node this node should point to

Definition at line 23 of file node.cxx.

00024 { 
00025   i.base = reinterpret_cast<uint32_t*>(v.iov_base);
00026   i.size_word = v.iov_len/4; 
00027   i.next = n;
00028 }

void eformat::write::cat ( node_t n,
const struct iovec *  v,
uint32_t  count 
)

Concatenates a set of IOV's to make up a list as required by some eformat::write functionality.

Parameters:
n the first node_t of a vector of node_t's. The C array pointed by n should have at least "count" available positions
v the first IOV node of a vector
count the number of IOV nodes pointed by "v"

Definition at line 30 of file node.cxx.

00031 {
00032   for (size_t i=0; i<(count-1); ++i) set(n[i], v[i], &n[i+1]);
00033   set(n[count-1], v[count-1], 0);
00034 }

void eformat::write::cat ( node_t n,
uint32_t  count 
)

Concatenates an already set vector of eformat::write::node_t to make up a valid list.

Parameters:
n the first node_t of a vector of node_t's. The C array pointed by n should have, exactly, "count" available positions
count the number of IOV nodes pointed by "v"

Definition at line 36 of file node.cxx.

References genRecEmupikp::i, next, and eformat::write::node_t::next.

00037 {
00038   for (size_t i=0; i<(count-1); ++i) n[i].next = &n[i+1];
00039   n[count-1].next = 0;
00040 }

uint32_t eformat::write::count ( const node_t list  ) 

Counts how many pages I'm made of

Parameters:
list The top of the list

Definition at line 42 of file node.cxx.

References eformat::write::node_t::next.

Referenced by eformat::write::FullEventFragment::FullEventFragment(), eformat::write::ROSFragment::ROSFragment(), and eformat::write::SubDetectorFragment::SubDetectorFragment().

00043 {
00044   const eformat::write::node_t* current = &list;
00045   uint32_t retval = 0;
00046   while (current) {
00047     ++retval;
00048     current = current->next;
00049   }
00050   return retval;
00051 }

uint32_t eformat::write::count_words ( const node_t list  ) 

Count how many words I'm made of

Parameters:
list The top of the list

Definition at line 53 of file node.cxx.

References eformat::write::node_t::next, and eformat::write::node_t::size_word.

00054 {
00055   const eformat::write::node_t* current = &list;
00056   uint32_t retval = 0;
00057   while (current) {
00058     retval += current->size_word;
00059     current = current->next;
00060   }
00061   return retval;
00062 }

uint32_t eformat::write::copy ( const node_t list,
uint32_t *  dest,
size_t  max 
)

Performs a memcpy like operation, concatenating the list given as parameter to a block of memory, as fast as possible.

Parameters:
list The top of the list
dest The destination block of memory
max The number of 32-bit words allocated in "dest"
Returns:
The number of words copied, in total. If the return value was zero, a problem with the total destination size length was detected and the copy operation may have undergone in an incomplete way

Definition at line 64 of file node.cxx.

References eformat::write::node_t::base, eformat::write::node_t::next, and eformat::write::node_t::size_word.

Referenced by Event::RelTable< T1, T2 >::bindRelationNoDup(), eformat::old::convert(), convert_ros(), TrkRecoTrk::copyReps(), EvtSpinAmp::EvtSpinAmp(), IRawDataCnvSvc::Leaf::operator=(), RootCnvSvc::Leaf::operator==(), IRawDataCnvSvc::Leaf::operator==(), and RawDataOutputSvc::putEvent().

00066 {
00067   const eformat::write::node_t* current = &list;
00068   uint32_t cpos = 0;
00069   while (current) {
00070     if (cpos + current->size_word > max) return 0;
00071     if (current->size_word > 0 && current->base) {
00072       memcpy(&dest[cpos], current->base, sizeof(uint32_t)*current->size_word);
00073       cpos += current->size_word;
00074     }
00075     current = current->next;
00076   }
00077   return cpos;
00078 }

uint32_t eformat::write::shallow_copy ( const node_t list,
struct iovec *  dest,
uint32_t  max 
)

Performs a shallow copy like operation, concatenating the list given as parameter to a vector of iovec nodes. This will only copy pointers and sizes, but not real data.

Parameters:
list The top of the list
dest The destination vector of iovec nodes
max The number of iovec nodes I can use there
Returns:
The number of pages used, in total. If the return value was zero, a problem with the total destination size length was detected and the copy operation may have undergone in an incomplete way

Definition at line 80 of file node.cxx.

References eformat::write::node_t::base, eformat::write::node_t::next, and eformat::write::node_t::size_word.

Referenced by main().

00082 {
00083   const eformat::write::node_t* current = &list;
00084   uint32_t cpos = 0;
00085   while (current) {
00086     if (cpos > max) return 0;
00087     if (current->size_word > 0 && current->base) {
00088       dest[cpos].iov_base = 
00089         reinterpret_cast<void*>(const_cast<uint32_t*>(current->base));
00090       dest[cpos].iov_len = sizeof(uint32_t)*current->size_word;
00091       ++cpos;
00092     }
00093     current = current->next;
00094   }
00095   return cpos;
00096 }

void eformat::write::set ( node_t i,
const uint32_t *  b,
size_t  l,
node_t n = 0 
)

Sets an IOV base values

Parameters:
i the node to be set
b the base address to be used by this IOV
l the size of the page, in words
n the next node this node should point to

Definition at line 16 of file node.cxx.

References genRecEmupikp::i.

00017 { 
00018   i.base = const_cast<uint32_t*>(b); 
00019   i.size_word = l; 
00020   i.next = n;
00021 }

void eformat::write::set ( node_t i,
const struct iovec &  v,
node_t n = 0 
)

Sets an IOV base values

Parameters:
i the node to be set
v the I/O vector node to use as basis
n the next node this node should point to

Definition at line 23 of file node.cxx.

References genRecEmupikp::i.

00024 { 
00025   i.base = reinterpret_cast<uint32_t*>(v.iov_base);
00026   i.size_word = v.iov_len/4; 
00027   i.next = n;
00028 }

void eformat::write::cat ( node_t n,
const struct iovec *  v,
uint32_t  count 
)

Concatenates a set of IOV's to make up a list as required by some eformat::write functionality.

Parameters:
n the first node_t of a vector of node_t's. The C array pointed by n should have at least "count" available positions
v the first IOV node of a vector
count the number of IOV nodes pointed by "v"

Definition at line 30 of file node.cxx.

References genRecEmupikp::i, and set().

00031 {
00032   for (size_t i=0; i<(count-1); ++i) set(n[i], v[i], &n[i+1]);
00033   set(n[count-1], v[count-1], 0);
00034 }

void eformat::write::cat ( node_t n,
uint32_t  count 
)

Concatenates an already set vector of eformat::write::node_t to make up a valid list.

Parameters:
n the first node_t of a vector of node_t's. The C array pointed by n should have, exactly, "count" available positions
count the number of IOV nodes pointed by "v"

Definition at line 36 of file node.cxx.

References genRecEmupikp::i, eformat::write::node_t::next, and next.

00037 {
00038   for (size_t i=0; i<(count-1); ++i) n[i].next = &n[i+1];
00039   n[count-1].next = 0;
00040 }

uint32_t eformat::write::count ( const node_t list  ) 

Counts how many pages I'm made of

Parameters:
list The top of the list

Definition at line 42 of file node.cxx.

References eformat::write::node_t::next.

Referenced by eformat::write::FullEventFragment::FullEventFragment(), eformat::write::ROSFragment::ROSFragment(), and eformat::write::SubDetectorFragment::SubDetectorFragment().

00043 {
00044   const eformat::write::node_t* current = &list;
00045   uint32_t retval = 0;
00046   while (current) {
00047     ++retval;
00048     current = current->next;
00049   }
00050   return retval;
00051 }

uint32_t eformat::write::count_words ( const node_t list  ) 

Count how many words I'm made of

Parameters:
list The top of the list

Definition at line 53 of file node.cxx.

References eformat::write::node_t::next, and eformat::write::node_t::size_word.

00054 {
00055   const eformat::write::node_t* current = &list;
00056   uint32_t retval = 0;
00057   while (current) {
00058     retval += current->size_word;
00059     current = current->next;
00060   }
00061   return retval;
00062 }

uint32_t eformat::write::copy ( const node_t list,
uint32_t *  dest,
size_t  max 
)

Performs a memcpy like operation, concatenating the list given as parameter to a block of memory, as fast as possible.

Parameters:
list The top of the list
dest The destination block of memory
max The number of 32-bit words allocated in "dest"
Returns:
The number of words copied, in total. If the return value was zero, a problem with the total destination size length was detected and the copy operation may have undergone in an incomplete way

Definition at line 64 of file node.cxx.

References eformat::write::node_t::base, eformat::write::node_t::next, and eformat::write::node_t::size_word.

Referenced by Event::RelTable< T1, T2 >::bindRelationNoDup(), eformat::old::convert(), convert_ros(), TrkRecoTrk::copyReps(), EvtSpinAmp::EvtSpinAmp(), IRawDataCnvSvc::Leaf::operator=(), IRawDataCnvSvc::Leaf::operator==(), RootCnvSvc::Leaf::operator==(), and RawDataOutputSvc::putEvent().

00066 {
00067   const eformat::write::node_t* current = &list;
00068   uint32_t cpos = 0;
00069   while (current) {
00070     if (cpos + current->size_word > max) return 0;
00071     if (current->size_word > 0 && current->base) {
00072       memcpy(&dest[cpos], current->base, sizeof(uint32_t)*current->size_word);
00073       cpos += current->size_word;
00074     }
00075     current = current->next;
00076   }
00077   return cpos;
00078 }

uint32_t eformat::write::shallow_copy ( const node_t list,
struct iovec *  dest,
uint32_t  max 
)

Performs a shallow copy like operation, concatenating the list given as parameter to a vector of iovec nodes. This will only copy pointers and sizes, but not real data.

Parameters:
list The top of the list
dest The destination vector of iovec nodes
max The number of iovec nodes I can use there
Returns:
The number of pages used, in total. If the return value was zero, a problem with the total destination size length was detected and the copy operation may have undergone in an incomplete way

Definition at line 80 of file node.cxx.

References eformat::write::node_t::base, eformat::write::node_t::next, and eformat::write::node_t::size_word.

Referenced by main().

00082 {
00083   const eformat::write::node_t* current = &list;
00084   uint32_t cpos = 0;
00085   while (current) {
00086     if (cpos > max) return 0;
00087     if (current->size_word > 0 && current->base) {
00088       dest[cpos].iov_base = 
00089         reinterpret_cast<void*>(const_cast<uint32_t*>(current->base));
00090       dest[cpos].iov_len = sizeof(uint32_t)*current->size_word;
00091       ++cpos;
00092     }
00093     current = current->next;
00094   }
00095   return cpos;
00096 }


Generated on Tue Nov 29 23:36:30 2016 for BOSS_7.0.2 by  doxygen 1.4.7