src/Network/Packet.hh
changeset 400 d64bf28c4340
parent 391 59c2499fe7bb
child 417 c503e0c6a740
--- a/src/Network/Packet.hh	Fri Jan 16 21:24:45 2009 +0200
+++ b/src/Network/Packet.hh	Fri Jan 16 22:03:49 2009 +0200
@@ -1,6 +1,12 @@
 #ifndef NETWORK_PACKET_HH
 #define NETWORK_PACKET_HH
 
+/**
+ * @file
+ *
+ * Provides the NetworkPackets that are used to communicate over a NetworkTCP/NetworkUDP sockets.
+ */
+
 #include "Config.hh"
 #include "../Types.hh"
 #include "../Error.hh"
@@ -101,6 +107,9 @@
     protected:
         /**
          * Adjust size of the most recent write_ptr area of buf_len bytes to data_len bytes.
+         *
+         * You must not call write() between calls to write_ptr() and write_ptr_adjust(). This is only valid for the
+         * most recent write_ptr()
          */
         virtual void write_ptr_adjust (size_t buf_len, size_t data_len) = 0;
 
@@ -182,7 +191,6 @@
          */
         char *buf_ptr;
         
-        // the buffer size, the amount of data in the buffer, and the current read/write offset
         /**
          * The size of the memory region pointed to by buf_ptr
          */
@@ -263,6 +271,8 @@
 
         /*
          * Accessor functions, used by the actual socket code to read/write the buffer
+         *
+         * XXX: own abstract class for these? Virtual methods <3
          */
         char* get_buf (void) { return buf_ptr; }
         const char* get_buf (void) const { return buf_ptr; }