00001
00011 #ifdef _MSC_VER
00012
00013 # pragma warning(disable:4231)
00014
00015
00016 # pragma warning(disable:4251)
00017
00018
00019 # pragma warning(disable:4275)
00020
00021
00022 # pragma warning(disable:4800)
00023 #endif
00024
00025 #include "datasrcs/CircularBuffer.h"
00026
00027 #include <boost/python.hpp>
00028
00029 using std::vector;
00030 using namespace boost::python;
00031
00032 namespace hippodraw {
00033 namespace Python {
00034
00035 void
00036 export_CircularBuffer()
00037 {
00038 class_ < CircularBuffer, bases < NTuple > >
00039 ( "CircularBuffer",
00040 "A circular buffer in a NTuple that adds rows up to a defined number,\n"
00041 "then starts replacing the oldest rows.",
00042 init<>
00043 ( "CircularBuffer ( None ) -> CircularBuffer\n"
00044 "CircularBuffer ( value ) -> CircularBuffer\n"
00045 "CircularBuffer ( string ) -> CircularBuffer\n"
00046 "CircularBuffer ( sequence ) -> CircularBuffer \n"
00047 "CircularBuffer ( CircularBuffer ) -> Circularbuffer\n"
00048 "\n"
00049 "There are five forms of construction of a CircularBuffer. The\n"
00050 "first form creates an empty one. The second from creates an empty\n"
00051 "one with `value' number of columns. The third from creates an\n"
00052 "empty one the number of columns equal to the size of the sequence.\n"
00053 "The column labels are taken from the sequence. The final form is\n"
00054 "the copy constructor." ) )
00055
00056 .def ( init < int > () )
00057
00058 .def ( init < const std::string & > () )
00059
00060 .def ( init < const std::vector < std::string > & > () )
00061
00062 .def ( init < const CircularBuffer & > () )
00063
00064 .add_property ( "rows", &CircularBuffer::rows )
00065
00066 .add_property ( "columns", &CircularBuffer::columns )
00067
00068 .def ( "addRow", &CircularBuffer::addRow,
00069 "addRow ( sequence ) -> None\n"
00070 "\n"
00071 "Append a row at the end of the table until it is full,\n"
00072 "then replace the oldest row." )
00073
00074 .def ( "reserve", &CircularBuffer::reserve,
00075 "reserve ( value ) -> None\n"
00076 "\n"
00077 "Sets the maximum size of the buffer" )
00078
00079 .def ( "clear", &CircularBuffer::clear,
00080 "clear ( None ) -> None\n"
00081 "\n"
00082 "Clears the contents of the buffer" )
00083
00084 ;
00085 }
00086
00087 }
00088 }