export_CircularBuffer.cxx
Go to the documentation of this file.
1 
11 #ifdef _MSC_VER
12 // nonstandard extension used 'extern' before...
13 # pragma warning(disable:4231)
14 
15 // needs to have dll-interface used by client
16 # pragma warning(disable:4251)
17 
18 // non dll-interface struct
19 # pragma warning(disable:4275)
20 
21 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
22 # pragma warning(disable:4800)
23 #endif
24 
25 // include first to avoid _POSIX_C_SOURCE warning.
26 #include <boost/python.hpp>
27 
29 
30 using std::vector;
31 using namespace boost::python;
32 
33 namespace hippodraw {
34 namespace Python {
35 
36 void
38 {
39  class_ < CircularBuffer, bases < NTuple > >
40  ( "CircularBuffer",
41  "A circular buffer in a NTuple that adds rows up to a defined number,\n"
42  "then starts replacing the oldest rows.",
43  init<>
44  ( "CircularBuffer ( None ) -> CircularBuffer\n"
45  "CircularBuffer ( value ) -> CircularBuffer\n"
46  "CircularBuffer ( string ) -> CircularBuffer\n"
47  "CircularBuffer ( sequence ) -> CircularBuffer \n"
48  "CircularBuffer ( CircularBuffer ) -> CircularBuffer\n"
49  "\n"
50  "There are five forms of construction of a CircularBuffer. The\n"
51  "first form creates an empty one. The second from creates an empty\n"
52  "one with `value' number of columns. The third from creates an\n"
53  "empty one the number of columns equal to the size of the sequence.\n"
54  "The column labels are taken from the sequence. The final form is\n"
55  "the copy constructor." ) )
56 
57  .def ( init < int > () )
58 
59  .def ( init < const std::string & > () )
60 
61  .def ( init < const std::vector < std::string > & > () )
62 
63  .def ( init < const CircularBuffer & > () )
64 
65  .add_property ( "rows", &CircularBuffer::rows )
66 
67  .add_property ( "columns", &CircularBuffer::columns )
68 
69  .def ( "addRow", &CircularBuffer::addRow,
70  "addRow ( sequence ) -> None\n"
71  "\n"
72  "Append a row at the end of the table until it is full,\n"
73  "then replace the oldest row." )
74 
75  .def ( "reserve", &CircularBuffer::reserve,
76  "reserve ( value ) -> None\n"
77  "\n"
78  "Sets the maximum size of the buffer" )
79 
80  .def ( "clear", &CircularBuffer::clear,
81  "clear ( None ) -> None\n"
82  "\n"
83  "Clears the contents of the buffer" )
84 
85  ;
86 }
87 
88 } // namespace Python
89 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen