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