13 # pragma warning(disable:4231)
16 # pragma warning(disable:4251)
19 # pragma warning(disable:4275)
22 # pragma warning(disable:4800)
26 #include <boost/python.hpp>
31 using namespace boost::python;
39 class_ < CircularBuffer, bases < NTuple > >
41 "A circular buffer in a NTuple that adds rows up to a defined number,\n"
42 "then starts replacing the oldest rows.",
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"
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." ) )
57 .def ( init < int > () )
59 .def ( init < const std::string & > () )
61 .def ( init <
const std::vector < std::string > & > () )
63 .def ( init < const CircularBuffer & > () )
65 .add_property (
"rows", &CircularBuffer::rows )
67 .add_property (
"columns", &CircularBuffer::columns )
69 .def (
"addRow", &CircularBuffer::addRow,
70 "addRow ( sequence ) -> None\n"
72 "Append a row at the end of the table until it is full,\n"
73 "then replace the oldest row." )
75 .def (
"reserve", &CircularBuffer::reserve,
76 "reserve ( value ) -> None\n"
78 "Sets the maximum size of the buffer" )
80 .def (
"clear", &CircularBuffer::clear,
81 "clear ( None ) -> None\n"
83 "Clears the contents of the buffer" )