00001 00002 #ifndef SIMPLE_CONVERTER_BOX_H 00003 #define SIMPLE_CONVERTER_BOX_H 00004 00005 #include "ConverterBox.h" 00006 00007 BOREALIS_NAMESPACE_BEGIN; 00008 00011 class SimpleConverterBox : public ConverterBox { 00012 protected: 00018 SimpleConverterBox(TupleDescription schema, char delim); 00019 00024 SimpleConverterBox(TupleDescription schema, unsigned int length); 00025 00027 ~SimpleConverterBox(); 00028 00033 virtual unsigned int handleData(constbuf input) 00034 throw (AuroraException); 00035 00042 virtual bool convertTuple(const char *data, unsigned int length, 00043 char *out) 00044 throw (AuroraException) = 0; 00045 00046 private: 00047 char _delim; 00048 unsigned int _length; 00049 00050 // Output buffer (size is tuple length) 00051 char *_output; 00052 00053 void checkSchemaLength(unsigned int tuple_size) throw (AuroraIllegalArgumentException); 00054 }; 00055 00056 BOREALIS_NAMESPACE_END; 00057 00058 #endif