Fixed some C/C++ compiler errors due to stricter checks.
[rubinius.git] / machine / marshal.hpp
blobc48b254d327239e4fb7f7e40d8e807fe18ece7cb
1 #ifndef RBX_MARSHAL_HPP
2 #define RBX_MARSHAL_HPP
4 #include <iostream>
5 #include <sstream>
7 #include "defines.hpp"
9 namespace rubinius {
11 class Object;
13 class InstructionSequence;
14 class CompiledCode;
15 class String;
16 class Encoding;
17 class Array;
18 class Bignum;
19 class Float;
20 class Symbol;
21 class Tuple;
23 class Marshaller {
24 public:
25 STATE;
26 CompiledCode* code;
27 std::ostream& stream;
29 Marshaller(STATE, CompiledCode* code, std::ostream& stream)
30 : state(state)
31 , code(code)
32 , stream(stream)
36 void marshal();
37 void marshal(Object* obj);
38 void put_compiled_code(CompiledCode* code);
39 void put_fixnum(Object* obj);
40 void put_string(const char* type, String* str);
41 void put_rational(Object* obj);
42 void put_complex(Object* obj);
43 void put_constant(Object* obj);
46 class UnMarshaller {
47 public:
48 STATE;
49 std::istream& stream;
51 UnMarshaller(STATE, std::istream& stream)
52 : state(state)
53 , stream(stream)
57 Object* unmarshal();
59 Object* get_int();
60 Object* get_rational();
61 Object* get_complex();
62 String* get_string();
63 Symbol* get_symbol();
64 Tuple* get_tuple();
66 Float* get_float();
67 InstructionSequence* get_iseq();
68 CompiledCode* get_compiled_code();
69 Object* get_constant();
70 Object* get_encoding();
72 public:
73 class Error {
74 const char* message_;
76 public:
77 Error(const char* msg)
78 : message_(msg)
81 const char* message() const {
82 return message_;
88 #endif