7 *\brief Tape data block base class.
9 * This class represents a Honeywell paper tape block.
10 * That may be some kind of data block or a end of tape mark.
20 TBT_DATA=0x10, //!< Data block
21 TBT_EOT, //!< End of tape block
22 TBT_BROKEN, //!< A broken block
26 *\brief Local base class for exceptions.
33 tape_block * get_block();
35 tape_block * m_broken_block;
39 *\brief Checksum error exception.
41 class checksum_error_exception
44 checksum_error_exception(tape_block * block);
48 *\brief EOF while reading block exception.
50 class eof_illegal_exception
53 eof_illegal_exception(tape_block * block);
57 *\brief EOF after reading block exception.
59 class eof_legal_exception
62 eof_legal_exception(int bytes_consumed);
66 tape_block * get_block();
70 *\brief IO error exception.
72 class io_error_exception
77 tape_block * get_block();
81 virtual ~tape_block();
83 tape_block(tape_block &);
84 void operator=(tape_block &);
86 virtual int get_type();
87 virtual int get_subtype();
88 virtual vector<string> get_description();
90 int get_discarded_bytes();
91 unsigned char * get_raw_data();
92 virtual int dump_to_fd(int fd);
93 virtual bool is_endblock();
94 virtual vector<string> get_exported_symbols();
95 virtual vector<string> get_called_symbols();
96 virtual bool has_known_type();
98 static tape_block * gen_from_fd(int fd,
99 void(*input_start)(void *)=0,
100 void (*input_stop)(void *)=0,
101 void * start_stop_arg=0
104 protected: // methods
106 string get_typestring();
109 tape_block (int fd_p,
110 void(*input_start)(void *)=0,
111 void (*input_stop)(void *)=0,
112 void * start_stop_arg=0
115 int init_words(void);
118 protected: // members
119 int block_type; //!< Type of this block.
120 bool m_has_known_type; //!< Block is of a documented type.
121 int discarded_bytes; //!< Amount of bytes discarded before beginning.
122 unsigned char * raw_data; //!< Raw block data in bytes.
123 int raw_size; //!< Size of the raw data.
124 unsigned short * word_data; //!< Data organized in machine words.
125 int word_size; //!< Size of the blocks in machine words.
126 int poolsize; //!< Amount of data malloc'ed
127 }; // class tape_block