aboutsummaryrefslogtreecommitdiffstats
path: root/include/pipe.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-03-14 17:49:30 +0000
committerlloyd <[email protected]>2008-03-14 17:49:30 +0000
commit1d5b656dc719f7411c96a2f416ad261bdfbca59b (patch)
tree09586fbe9d266c7273d8fc88f801240004b15bf8 /include/pipe.h
parent83de95aacd2b1e82f885b62676622f2723276671 (diff)
Use a special typedef, Pipe::message_id, rather than a bare u32bit,
to represent the message number in a Pipe
Diffstat (limited to 'include/pipe.h')
-rw-r--r--include/pipe.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/include/pipe.h b/include/pipe.h
index 9bc98a72b..9bf05b76a 100644
--- a/include/pipe.h
+++ b/include/pipe.h
@@ -18,7 +18,9 @@ namespace Botan {
class Pipe : public DataSource
{
public:
- static const u32bit LAST_MESSAGE, DEFAULT_MESSAGE;
+ typedef u32bit message_id;
+
+ static const message_id LAST_MESSAGE, DEFAULT_MESSAGE;
void write(const byte[], u32bit);
void write(const MemoryRegion<byte>&);
@@ -31,21 +33,21 @@ class Pipe : public DataSource
void process_msg(const std::string&);
void process_msg(DataSource&);
- u32bit remaining(u32bit = DEFAULT_MESSAGE) const;
+ u32bit remaining(message_id = DEFAULT_MESSAGE) const;
u32bit read(byte[], u32bit);
- u32bit read(byte[], u32bit, u32bit);
- u32bit read(byte&, u32bit = DEFAULT_MESSAGE);
+ u32bit read(byte[], u32bit, message_id);
+ u32bit read(byte&, message_id = DEFAULT_MESSAGE);
- SecureVector<byte> read_all(u32bit = DEFAULT_MESSAGE);
- std::string read_all_as_string(u32bit = DEFAULT_MESSAGE);
+ SecureVector<byte> read_all(message_id = DEFAULT_MESSAGE);
+ std::string read_all_as_string(message_id = DEFAULT_MESSAGE);
u32bit peek(byte[], u32bit, u32bit) const;
- u32bit peek(byte[], u32bit, u32bit, u32bit) const;
- u32bit peek(byte&, u32bit, u32bit = DEFAULT_MESSAGE) const;
+ u32bit peek(byte[], u32bit, u32bit, message_id) const;
+ u32bit peek(byte&, u32bit, message_id = DEFAULT_MESSAGE) const;
- u32bit default_msg() const { return default_read; }
- void set_default_msg(u32bit);
+ message_id default_msg() const { return default_read; }
+ void set_default_msg(message_id);
u32bit message_count() const;
bool end_of_data() const;
@@ -68,11 +70,11 @@ class Pipe : public DataSource
void find_endpoints(Filter*);
void clear_endpoints(Filter*);
- u32bit get_message_no(const std::string&, u32bit) const;
+ message_id get_message_no(const std::string&, message_id) const;
Filter* pipe;
class Output_Buffers* outputs;
- u32bit default_read;
+ message_id default_read;
bool inside_msg;
};