Description:
This class is for encoding Swift Large Data Products as CCSDS packets. In real life this will be done on-board the spacrcraft, so this class is for generating test data. Note that the onboard software may have its own quirks.
To use this class you should hook the output drain returned by the pipe() method to some chain of processing pipes. Then you probably want to wrap the LDPEncodeBuffer in an ostream. Then you can write to the ostream as you would any file. The data will be encoded in LDPPackets and sent down the drain pipe.
When you are done writing data you need to explicitly call the close() method.
Data Fields | ||
private | static const int | WRITING_HEADER |
private | static const int | DONE_WRITING_HEADER |
private | static const int | PAST_HEADER |
private | static const int | CLOSED |
private | StandardLDPHead* | head |
private | LDPPacket* | packet |
private | int | status |
private | vector<LDPPacket*> | header_packets |
private | int | size |
private | double | time_increment |
private | unsigned char* | data |
private | unsigned char* | end |
private | PacketPipe | _pipe |
private | int | count |
Constructors / Destructor | |
public | LDPEncodeBuffer(LDPPacket* p, StandardLDPHead* head, DataBlock* extra_head=NULL, double time_increment=0.01)Throws: Interpreter: :Exception |
Methods | |||
public | virtual | PacketPipe& | pipe() |
public | virtual | void | close()End the file. This flushes out the last packet being written and writes out the redundant header packets. |
public | virtual | int | overflow(int c = EOF) |
private | virtual | void | nextPacket()Update the packet. |
Operators |