00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #ifndef avro_Types_hh__
00020 #define avro_Types_hh__
00021 
00022 #include <iostream>
00023 
00024 #include "Config.hh"
00025 
00026 namespace avro {
00027 
00031 enum Type {
00032 
00033     AVRO_STRING,    
00034     AVRO_BYTES,     
00035     AVRO_INT,       
00036     AVRO_LONG,      
00037     AVRO_FLOAT,     
00038     AVRO_DOUBLE,    
00039     AVRO_BOOL,      
00040     AVRO_NULL,      
00042     AVRO_RECORD,    
00043     AVRO_ENUM,      
00044     AVRO_ARRAY,     
00045     AVRO_MAP,       
00046     AVRO_UNION,     
00047     AVRO_FIXED,     
00049     AVRO_NUM_TYPES, 
00051     
00052     
00053     AVRO_SYMBOLIC = AVRO_NUM_TYPES, 
00054     AVRO_UNKNOWN  = -1 
00056 };
00057 
00063 inline bool isPrimitive(Type t) {
00064     return (t >= AVRO_STRING) && (t < AVRO_RECORD);
00065 }
00066 
00072 inline bool isCompound(Type t) {
00073     return (t>= AVRO_RECORD) && (t < AVRO_NUM_TYPES);
00074 }
00075 
00079 inline bool isAvroType(Type t) {
00080     return (t >= AVRO_STRING) && (t < AVRO_NUM_TYPES);
00081 }
00082 
00087 inline bool isAvroTypeOrPseudoType(Type t) {
00088     return (t >= AVRO_STRING) && (t <= AVRO_NUM_TYPES);
00089 }
00090 
00094 AVRO_DECL const std::string& toString(Type type);
00095 
00099 AVRO_DECL std::ostream &operator<< (std::ostream &os, avro::Type type);
00100 
00102 struct AVRO_DECL Null { };
00103 
00109 std::ostream& operator<< (std::ostream &os, const Null &null);
00110 
00111 } 
00112 
00113 
00114 #endif