fork(1) download
  1. class blob {
  2. private:
  3. blob(const blob& other ); // non construction-copyable
  4. blob& operator=( const blob& ); // non copyable
  5.  
  6. protected:
  7. uint32 _valid;
  8. buffer _buffer; // Binary data. Since we're a binary data blob it *only makes sense*
  9. blob_type _type; // Blob type, as defined in enums
  10. blob_destination _dest; // Blob destination...OK, this is odd
  11.  
  12. virtual uint32 stream_out(std::ostream& os) = 0; // For << operator used on log_event class. For testing purposes MOSTLY! MAY ALSO BE USED TO ACTUALLY PRINT THE F*CKING EVENT!
  13.  
  14. virtual uint32 can_serialize() = 0; // Query - can we serialize?
  15. virtual uint32 serialize() = 0; // Serialization is *not* the same as packetization
  16. virtual uint32 deserialize() = 0; // Undo the last one
  17.  
  18. virtual uint32 can_packetize() = 0; // Query - can we packetize?
  19.  
  20. virtual uint32 bloblob() = 0; // Lob() actually just calls this. Kind of silly, but also pretty nice in a lot of ways - kc::io::lob(my object) is pretty clear.
  21.  
  22. uint32 packet_header_valid(); // Checks if the packet header at our current _buffer location is valid
  23.  
  24. public:
  25. blob() { _valid = 0; }
  26. virtual ~blob() { }
  27.  
  28. virtual uint32 packetize() = 0; // Yeah.
  29. virtual uint32 packet_validate() = 0; // Checks that a packet is valid
  30. virtual uint32 packet_parse() = 0; // Parses a packet
  31.  
  32. friend std::ostream& operator<<(std::ostream& os, blob& me);
  33.  
  34.  
  35. friend uint32 lob(blob &_blob);
  36. };
  37.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7: error: ‘uint32’ does not name a type
prog.cpp:8: error: ‘buffer’ does not name a type
prog.cpp:9: error: ‘blob_type’ does not name a type
prog.cpp:10: error: ‘blob_destination’ does not name a type
prog.cpp:12: error: ‘uint32’ does not name a type
prog.cpp:14: error: ‘uint32’ does not name a type
prog.cpp:15: error: ‘uint32’ does not name a type
prog.cpp:16: error: ‘uint32’ does not name a type
prog.cpp:18: error: ‘uint32’ does not name a type
prog.cpp:20: error: ‘uint32’ does not name a type
prog.cpp:22: error: ‘uint32’ does not name a type
prog.cpp:28: error: ‘uint32’ does not name a type
prog.cpp:29: error: ‘uint32’ does not name a type
prog.cpp:30: error: ‘uint32’ does not name a type
prog.cpp:32: error: ISO C++ forbids declaration of ‘ostream’ with no type
prog.cpp:32: error: ‘ostream’ is neither function nor member function; cannot be declared friend
prog.cpp:32: error: expected ‘;’ before ‘&’ token
prog.cpp:35: error: ‘uint32’ does not name a type
prog.cpp: In constructor ‘blob::blob()’:
prog.cpp:25: error: ‘_valid’ was not declared in this scope
stdout
Standard output is empty