Changes to variant to extend functionality for some binding needs
authorJohannes Schanda <schanda@itestra.de>
Fri, 24 May 2013 09:16:02 +0000 (11:16 +0200)
committerJohannes Schanda <schanda@itestra.de>
Thu, 6 Jun 2013 09:08:34 +0000 (11:08 +0200)
src/CommonAPI/InputStream.h
src/CommonAPI/OutputStream.h
src/CommonAPI/SerializableVariant.h

index 798439c..3e03f76 100644 (file)
@@ -68,6 +68,8 @@ class InputStream {
 
     virtual void readSerializableVariant(SerializableVariant& serializableVariant) = 0;
 
+    virtual char* readRawData(const size_t numBytesToRead) = 0;
+
     virtual void beginReadBoolVector() = 0;
     virtual void beginReadInt8Vector() = 0;
     virtual void beginReadInt16Vector() = 0;
index 58651b1..517aaa8 100644 (file)
@@ -321,6 +321,8 @@ class OutputStream {
        virtual void endWriteMap() = 0;
        virtual void beginWriteMapElement() = 0;
        virtual void endWriteMapElement() = 0;
+
+       virtual bool writeRawData(const char* rawDataPtr, const size_t sizeInByte) = 0;
 };
 
 
index 37f7320..a842fda 100644 (file)
@@ -218,9 +218,6 @@ public:
     }
 
 private:
-    inline bool hasValue() const {
-        return valueType_ <= TypesTupleSize::value;
-    }
 
     template<typename _U>
     void set( const _U& value, const bool clear);
@@ -228,7 +225,7 @@ private:
     template<typename _U>
     void set( _U&& value, const bool clear);
 
-    template<typename >
+    template<typename _FriendType>
     friend struct TypeWriter;
     template<typename ... _FriendTypes>
     friend struct AssignmentVisitor;
@@ -241,6 +238,10 @@ private:
     template<class Variant, typename ... _FTypes>
     friend struct ApplyVoidIndexVisitor;
 
+protected:
+    inline bool hasValue() const {
+        return valueType_ < TypesTupleSize::value;
+    }
     uint8_t valueType_;
     typename std::aligned_storage<maxSize>::type valueStorage_;
 };