BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
node.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file eformat_write/node.h
5 * @author <a href="mailto:[email protected]">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * @brief Defines what are eformat::write::node's and their functionality.
11 */
12
13#ifndef EFORMAT_WRITE_NODE_H
14#define EFORMAT_WRITE_NODE_H
15
16#include <stdint.h>
17#include <sys/uio.h>
18
19namespace eformat {
20
21 namespace write {
22
23 /**
24 * Defines what is a valid "I/O vector" (a.k.a. iov) node list for eformat
25 */
26 typedef struct node_t {
27 uint32_t* base; ///< The base address for this page
28 size_t size_word; ///< The size, in 4-byte words for this page
29 node_t* next; ///< The next node
30 } node_t;
31
32 /**
33 * Sets an IOV base values
34 *
35 * @param i the node to be set
36 * @param b the base address to be used by this IOV
37 * @param l the size of the page, <b>in words</b>
38 * @param n the next node this node should point to
39 */
40 void set (node_t& i, const uint32_t* b, size_t l, node_t* n=0);
41
42 /**
43 * Sets an IOV base values
44 *
45 * @param i the node to be set
46 * @param v the I/O vector node to use as basis
47 * @param n the next node this node should point to
48 */
49 void set (node_t& i, const struct iovec& v, node_t* n=0);
50
51 /**
52 * Concatenates a set of IOV's to make up a list as required by some
53 * eformat::write functionality.
54 *
55 * @param n the first node_t of a vector of node_t's. The C array pointed
56 * by n should have at least "count" available positions
57 * @param v the first IOV node of a vector
58 * @param count the number of IOV nodes pointed by "v"
59 */
60 void cat (node_t* n, const struct iovec* v, uint32_t count);
61
62 /**
63 * Concatenates an already set vector of eformat::write::node_t to make up
64 * a valid list.
65 *
66 * @param n the first node_t of a vector of node_t's. The C array pointed
67 * by n should have, exactly, "count" available positions
68 * @param count the number of IOV nodes pointed by "v"
69 */
70 void cat (node_t* n, uint32_t count);
71
72 /**
73 * Counts how many pages I'm made of
74 *
75 * @param list The top of the list
76 */
77 uint32_t count (const node_t& list);
78
79 /**
80 * Count how many words I'm made of
81 *
82 * @param list The top of the list
83 */
84 uint32_t count_words (const node_t& list);
85
86 /**
87 * Performs a memcpy like operation, concatenating the list given as
88 * parameter to a block of memory, as fast as possible.
89 *
90 * @param list The top of the list
91 * @param dest The destination block of memory
92 * @param max The number of 32-bit words allocated in "dest"
93 *
94 * @return The number of words copied, in total. If the return value was
95 * zero, a problem with the total destination size length was detected and
96 * the copy operation may have undergone in an incomplete way
97 */
98 uint32_t copy (const node_t& list, uint32_t* dest, size_t max);
99
100 /**
101 * Performs a shallow copy like operation, concatenating the list given as
102 * parameter to a vector of iovec nodes. This will only copy pointers and
103 * sizes, but @b not real data.
104 *
105 * @param list The top of the list
106 * @param dest The destination vector of iovec nodes
107 * @param max The number of iovec nodes I can use there
108 *
109 * @return The number of pages used, in total. If the return value was
110 * zero, a problem with the total destination size length was detected and
111 * the copy operation may have undergone in an incomplete way
112 */
113 uint32_t shallow_copy
114 (const node_t& list, struct iovec* dest, uint32_t max);
115
116
117 }
118
119}
120
121#endif /* EFORMAT_WRITE_NODE_H */
const Int_t n
DOUBLE_PRECISION count[3]
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
uint32_t shallow_copy(const node_t &list, struct iovec *dest, uint32_t max)
Definition: node.cxx:80
uint32_t copy(const node_t &list, uint32_t *dest, size_t max)
Definition: node.cxx:64
void set(node_t &i, const uint32_t *b, size_t l, node_t *n=0)
Definition: node.cxx:16
uint32_t count_words(const node_t &list)
Definition: node.cxx:53
void cat(node_t *n, const struct iovec *v, uint32_t count)
Definition: node.cxx:30
const double b
Definition: slope.cxx:9
node_t * next
The next node.
Definition: node.h:29
uint32_t * base
The base address for this page.
Definition: node.h:27
size_t size_word
The size, in 4-byte words for this page.
Definition: node.h:28