Types.hh

00001 
00019 #ifndef avro_Types_hh__
00020 #define avro_Types_hh__
00021 
00022 #include <iostream>
00023 
00024 namespace avro {
00025 
00026 enum Type {
00027 
00028     AVRO_STRING,
00029     AVRO_BYTES,
00030     AVRO_INT,
00031     AVRO_LONG,
00032     AVRO_FLOAT,
00033     AVRO_DOUBLE,
00034     AVRO_BOOL,
00035     AVRO_NULL,
00036 
00037     AVRO_RECORD,
00038     AVRO_ENUM,
00039     AVRO_ARRAY,
00040     AVRO_MAP,
00041     AVRO_UNION,
00042     AVRO_FIXED,
00043 
00044     AVRO_NUM_TYPES, // marker
00045     
00046     // The following is a pseudo-type used in implementation
00047     
00048     AVRO_SYMBOLIC = AVRO_NUM_TYPES
00049 
00050 };
00051 
00052 inline bool isPrimitive(Type t) {
00053     return (t >= AVRO_STRING) && (t < AVRO_RECORD);
00054 }
00055 
00056 inline bool isCompound(Type t) {
00057     return (t>= AVRO_RECORD) && (t < AVRO_NUM_TYPES);
00058 }
00059 
00060 inline bool isAvroType(Type t) {
00061     return (t >= AVRO_STRING) && (t < AVRO_NUM_TYPES);
00062 }
00063 
00064 inline bool isAvroTypeOrPseudoType(Type t) {
00065     return (t >= AVRO_STRING) && (t <= AVRO_NUM_TYPES);
00066 }
00067 
00068 
00069 std::ostream &operator<< (std::ostream &os, avro::Type type);
00070 
00072 struct Null { };
00073 
00074 std::ostream& operator<< (std::ostream &os, const Null &null);
00075 
00076 } // namespace avro
00077 
00078 
00079 #endif

Generated on Fri Mar 12 13:20:47 2010 for Avro C++ by  doxygen 1.6.1