diff options
author | Henning Baldersheim <balder@oath.com> | 2018-02-08 22:20:59 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-02-08 22:20:59 +0100 |
commit | c5efc8a165778b83bf0256663c8f6d69348bb929 (patch) | |
tree | eebc97063a0ec492ef865b66ca715fefb4747172 /frtstream | |
parent | bd90807da307dc205f24386f1b96546dd1b039c5 (diff) |
Remove no longer used frtstream
Diffstat (limited to 'frtstream')
-rw-r--r-- | frtstream/.gitignore | 1 | ||||
-rw-r--r-- | frtstream/CMakeLists.txt | 12 | ||||
-rw-r--r-- | frtstream/OWNERS | 1 | ||||
-rw-r--r-- | frtstream/README | 1 | ||||
-rw-r--r-- | frtstream/docs/introduction.txt | 27 | ||||
-rw-r--r-- | frtstream/src/.gitignore | 4 | ||||
-rw-r--r-- | frtstream/src/example/.gitignore | 3 | ||||
-rw-r--r-- | frtstream/src/example/CMakeLists.txt | 2 | ||||
-rw-r--r-- | frtstream/src/example/simple.cpp | 39 | ||||
-rw-r--r-- | frtstream/src/example/test.cpp | 72 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/.gitignore | 2 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/CMakeLists.txt | 7 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/frtclientstream.cpp | 57 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/frtclientstream.h | 31 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/frtserverstream.h | 28 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/frtstream.cpp | 64 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/frtstream.h | 90 | ||||
-rw-r--r-- | frtstream/src/vespa/frtstream/frtstreamTemplateImp.hpp | 202 |
18 files changed, 0 insertions, 643 deletions
diff --git a/frtstream/.gitignore b/frtstream/.gitignore deleted file mode 100644 index f3c7a7c5da6..00000000000 --- a/frtstream/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Makefile diff --git a/frtstream/CMakeLists.txt b/frtstream/CMakeLists.txt deleted file mode 100644 index 0359827d338..00000000000 --- a/frtstream/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_define_module( - DEPENDS - fastos - fnet - - LIBS - src/vespa/frtstream - - TESTS - src/example -) diff --git a/frtstream/OWNERS b/frtstream/OWNERS deleted file mode 100644 index 31af040f698..00000000000 --- a/frtstream/OWNERS +++ /dev/null @@ -1 +0,0 @@ -bratseth diff --git a/frtstream/README b/frtstream/README deleted file mode 100644 index 6c53b361cdd..00000000000 --- a/frtstream/README +++ /dev/null @@ -1 +0,0 @@ -Library used by file distribution.
\ No newline at end of file diff --git a/frtstream/docs/introduction.txt b/frtstream/docs/introduction.txt deleted file mode 100644 index d733d7be0da..00000000000 --- a/frtstream/docs/introduction.txt +++ /dev/null @@ -1,27 +0,0 @@ -FrtStream provides an iostream like interface to Frt. It consists of -two main parts: FrtClientStream and FrtServerStream. Both streams can -read/write integers, floating point numbers, strings(std), and -standard c++ containers containing these types. Other types can be -added by operator overloading.( like for iostreams ) - -FrtClientStream -This is a complete abstraction for making simple Frt clients. -It's used the following way: - -FrtClientStream s(<connectionSpec>); -s <<Method(<methodName>) <<param1 <<param2 ... <<paramN; -s >> result1 >>result2 ... >>resultn - -s <<Method(<methodName2>) ... - - - -FrtServerStream -This is currently only a wrapper to use around Request -objects on the server to ease working with parameters and return -values. It's used inside method handlers by making a FrtServerStream -on the stack and passing the request object to it's constructor: - -FrtServerStream s(request); -s >>param1 >>param2 .... >>paramn -s <<return1 <<return2 ... <<returnn. diff --git a/frtstream/src/.gitignore b/frtstream/src/.gitignore deleted file mode 100644 index d7136fc6881..00000000000 --- a/frtstream/src/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile.ini -config_command.sh -frtstream.mak -project.dsw diff --git a/frtstream/src/example/.gitignore b/frtstream/src/example/.gitignore deleted file mode 100644 index 56ab7d7b794..00000000000 --- a/frtstream/src/example/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -test -/.depend diff --git a/frtstream/src/example/CMakeLists.txt b/frtstream/src/example/CMakeLists.txt deleted file mode 100644 index 7bd758a866c..00000000000 --- a/frtstream/src/example/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -# Ignored! diff --git a/frtstream/src/example/simple.cpp b/frtstream/src/example/simple.cpp deleted file mode 100644 index 921f278b794..00000000000 --- a/frtstream/src/example/simple.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/app.h> - -#include <vespa/frtstream/frtclientstream.h> - -using namespace std; -using frtstream::FrtClientStream; -using frtstream::Method; -using frtstream::InvokationException; - -const string connectionSpec = "tcp/test-tonyv:9997"; - -class TestApp : public FastOS_Application { -public: - int Main() { - FrtClientStream s(connectionSpec); - - try { - s <<Method("add") <<1 <<2; - - int res; - s >> res; - - cout <<"Result = " <<res <<endl; - } catch(const InvokationException& e) { - cerr <<e <<endl; - } - return 0; - - } -}; - - -int main(int argc, char** argv) { - TestApp app; - return app.Entry(argc, argv); - - -} diff --git a/frtstream/src/example/test.cpp b/frtstream/src/example/test.cpp deleted file mode 100644 index 8cbe8b74944..00000000000 --- a/frtstream/src/example/test.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/frtstream/frtclientstream.h> - -#include <iostream> -#include <csignal> -#include <vector> -#include <string> -#include <set> - -using namespace std; -using frtstream::FrtClientStream; -using frtstream::Method; -using frtstream::InvokationException; - -const string connectionSpec = "tcp/test-tonyv:9997"; - -class TestApp : public FastOS_Application { -public: - int Main() { - FrtClientStream s(connectionSpec); - - std::vector<std::string> vec; - vec.push_back("Hello"); vec.push_back("world"); - - std::set<std::string> codeSet; - codeSet.insert("abc"); codeSet.insert("def"); - - std::vector<double> doubleVec; - doubleVec.push_back(99.98); doubleVec.push_back(98.97); - - std::vector<float> floatVec; - floatVec.push_back(99.98); floatVec.push_back(98.97); - - uint8_t i1 = 1; - int8_t i2 = 2; - - uint16_t i3 = 1; - int16_t i4 = 2; - - uint32_t i5 = 1; - int32_t i6 = 2; - - uint64_t i7 = 1; - int64_t i8 = 2; - - float f1 = 3.14; - double d1 = 123.456; - - try { - s <<Method("add") <<1 <<2 <<i1 <<f1 <<d1 <<vec <<codeSet <<doubleVec <<floatVec - <<i1 <<i2 <<i3 <<i4 <<i5 <<i6 <<i7 <<i8; - - int res; - s >> res >>vec >>codeSet >>doubleVec >>floatVec >>i1 >>f1 >>d1 - >>i1 >>i2 >>i3 >>i4 >>i5 >>i6 >>i7 >>i8; - - cout <<"Result = " <<res <<endl; - } catch(const InvokationException& e) { - cerr <<e <<endl; - } - return 0; - - } -}; - - -int main(int argc, char** argv) { - TestApp app; - return app.Entry(argc, argv); - - -} diff --git a/frtstream/src/vespa/frtstream/.gitignore b/frtstream/src/vespa/frtstream/.gitignore deleted file mode 100644 index 5dae353d999..00000000000 --- a/frtstream/src/vespa/frtstream/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.depend -Makefile diff --git a/frtstream/src/vespa/frtstream/CMakeLists.txt b/frtstream/src/vespa/frtstream/CMakeLists.txt deleted file mode 100644 index ef2dd58b211..00000000000 --- a/frtstream/src/vespa/frtstream/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -vespa_add_library(frtstream STATIC - SOURCES - frtclientstream.cpp - frtstream.cpp - DEPENDS -) diff --git a/frtstream/src/vespa/frtstream/frtclientstream.cpp b/frtstream/src/vespa/frtstream/frtclientstream.cpp deleted file mode 100644 index a9fa140eb86..00000000000 --- a/frtstream/src/vespa/frtstream/frtclientstream.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "frtclientstream.h" -#include <vespa/fnet/frt/target.h> -#include <vespa/fnet/frt/rpcrequest.h> - -using namespace fnet; - -namespace frtstream { - -FrtClientStream::FrtClientStream(const std::string& connectionSpec) - : timeout(30), - executed(false), - _nextOutValue(0) - -{ - supervisor.Start(); - target = supervisor.GetTarget(connectionSpec.c_str()); - if( ! target ) { - supervisor.ShutDown(true); - throw ConnectionException(); - } - request = supervisor.AllocRPCRequest(); -} - -FrtClientStream::~FrtClientStream() { - request->SubRef(); - target->SubRef(); - supervisor.ShutDown(true); -} - -FrtClientStream& FrtClientStream::operator<<(const Method& m) { - executed = false; - request = supervisor.AllocRPCRequest(request); - request->SetMethodName(m.name().c_str()); - - return *this; -} - -FRT_Values& FrtClientStream::in() { - return *request->GetParams(); -} -FRT_Value& FrtClientStream::nextOut() { - if(! executed ) { - target->InvokeSync(request, timeout); - executed = true; - _nextOutValue = 0; - if( request->GetErrorCode() != FRTE_NO_ERROR ) { - throw InvokationException(request->GetErrorCode(), - request->GetErrorMessage()); - } - } - return request->GetReturn()->GetValue(_nextOutValue++); -} - - -} //end namespace frtstream diff --git a/frtstream/src/vespa/frtstream/frtclientstream.h b/frtstream/src/vespa/frtstream/frtclientstream.h deleted file mode 100644 index 7c0eb6f720a..00000000000 --- a/frtstream/src/vespa/frtstream/frtclientstream.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#pragma once - -#include "frtstream.h" -#include <vespa/fnet/frt/supervisor.h> - -namespace frtstream { - -class FrtClientStream : public FrtStream { - FRT_Supervisor supervisor; - FRT_RPCRequest* request; - const double timeout; - - FRT_Target* target; - bool executed; - uint32_t _nextOutValue; - - FRT_Values& in() override; - FRT_Value& nextOut() override; -public: - FrtClientStream(const std::string& connectionSpec); - ~FrtClientStream(); - - using FrtStream::operator<<; - using FrtStream::operator>>; - FrtClientStream& operator<<(const Method& m); -}; - -} //end namespace frtstream - diff --git a/frtstream/src/vespa/frtstream/frtserverstream.h b/frtstream/src/vespa/frtstream/frtserverstream.h deleted file mode 100644 index aefe2c8639b..00000000000 --- a/frtstream/src/vespa/frtstream/frtserverstream.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -#include <vespa/frtstream/frtstream.h> - -namespace frtstream { - -class FrtServerStream : public FrtStream { - FRT_RPCRequest* request; - uint32_t _nextOutValue; - - FRT_Values& in() override { - return *request->GetReturn(); - } - - FRT_Value& nextOut() override { - return request->GetParams()->GetValue(_nextOutValue++); - } -public: - FrtServerStream(FRT_RPCRequest* req) : - request(req), - _nextOutValue(0) {} - - using FrtStream::operator<<; - using FrtStream::operator>>; -}; - -} //end namespace frtstream diff --git a/frtstream/src/vespa/frtstream/frtstream.cpp b/frtstream/src/vespa/frtstream/frtstream.cpp deleted file mode 100644 index 6a3a3b72641..00000000000 --- a/frtstream/src/vespa/frtstream/frtstream.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "frtstream.h" -#include <algorithm> -#include <ostream> - -using namespace fnet; - -namespace frtstream { - - - -#define _FRTSTREAM_INTEGER_OPERATOR(bits) \ -FrtStream& FrtStream::operator<<(uint##bits##_t i) { \ - in().AddInt##bits(i); \ - return *this; \ -} \ -FrtStream& FrtStream::operator>>(uint##bits##_t &i) { \ - i = nextOut()._intval##bits; \ - return *this; \ -} - -_FRTSTREAM_INTEGER_OPERATOR(8); -_FRTSTREAM_INTEGER_OPERATOR(16); -_FRTSTREAM_INTEGER_OPERATOR(32); -_FRTSTREAM_INTEGER_OPERATOR(64); -#undef _FRTSTREAM_INTEGER_OPERATOR - -#define _FRTSTREAM_FLOAT_OPERATOR(floatType, floatTypeCapitalized) \ -FrtStream& FrtStream::operator<<(floatType i) { \ - in().Add##floatTypeCapitalized(i); \ - return *this; \ -} \ -FrtStream& FrtStream::operator>>(floatType &i) { \ - i = nextOut()._##floatType; \ - return *this; \ -} - -_FRTSTREAM_FLOAT_OPERATOR(float, Float); -_FRTSTREAM_FLOAT_OPERATOR(double, Double); -#undef _FRTSTREAM_FLOAT_OPERATOR - -FrtStream& FrtStream::operator<<(const std::string &str) { - in().AddString(str.c_str()); - return *this; -} - -FrtStream& FrtStream::operator>>(std::string &str) { - str = nextOut()._string._str; - return *this; -} - - -std::ostream& operator<<(std::ostream& s, const InvokationException& e) { - s <<"InvocationException: " <<std::endl - <<"ErrorCode: " <<e.errorCode <<std::endl - <<"ErrorMessage: " <<e.errorMessage; - return s; -} - - - - -} //end namespace frtstream diff --git a/frtstream/src/vespa/frtstream/frtstream.h b/frtstream/src/vespa/frtstream/frtstream.h deleted file mode 100644 index aec57598578..00000000000 --- a/frtstream/src/vespa/frtstream/frtstream.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#pragma once - -#include <vespa/fnet/frt/values.h> -#include <string> -#include <memory> -#include <algorithm> -#include <iosfwd> -#include <iterator> - -namespace frtstream { - -class ConnectionException{}; -class InvokationException{ -public: - - uint32_t errorCode; - std::string errorMessage; - InvokationException(uint32_t code, const std::string& msg ): - errorCode(code), errorMessage(msg) {} -}; - -std::ostream& operator<<(std::ostream& s, const InvokationException& e); - - -class Method { - std::string _name; -public: - Method(const std::string& methodName) : - _name(methodName) {} - //implement in the future along with typechecking - //Method(const std::string& name, const std::string& typeString); - - std::string name() const { - return _name; - } -}; - -class FrtStream { -protected: - virtual FRT_Values& in() = 0; - virtual FRT_Value& nextOut() = 0; - -public: - virtual ~FrtStream() {} - -#define _FRTSTREAM_INTOPERATOR(bits) \ - FrtStream& operator<<(uint##bits##_t); \ - FrtStream& operator>>(uint##bits##_t&); \ - FrtStream& operator<<(int##bits##_t val) { \ - operator<<(static_cast<uint##bits##_t>(val)); \ - return *this; \ - } \ - FrtStream& operator>>(int##bits##_t &val) { \ - uint##bits##_t temp; \ - *this>>temp; \ - val = static_cast<int##bits##_t>(val); \ - return *this; \ - } - - _FRTSTREAM_INTOPERATOR(8); - _FRTSTREAM_INTOPERATOR(16); - _FRTSTREAM_INTOPERATOR(32); - _FRTSTREAM_INTOPERATOR(64); -#undef _FRTSTREAM_INTOPERATOR - - FrtStream& operator<<(float); - FrtStream& operator>>(float&); - - FrtStream& operator<<(double); - FrtStream& operator>>(double&); - - FrtStream& operator<<(const std::string &str); - FrtStream& operator>>(std::string &str); - - FrtStream& operator<<(std::string &str); - - template <template<typename, typename> class CONT, class T, class ALLOC> - FrtStream& operator<<( const CONT<T, ALLOC> & cont ); - - template <template<typename, typename> class CONT, class T, class ALLOC> - FrtStream& operator>>( CONT<T, ALLOC> & cont ); -}; - - -} //end namespace frtstream - - -#include "frtstreamTemplateImp.hpp" - diff --git a/frtstream/src/vespa/frtstream/frtstreamTemplateImp.hpp b/frtstream/src/vespa/frtstream/frtstreamTemplateImp.hpp deleted file mode 100644 index bea6d2a9fac..00000000000 --- a/frtstream/src/vespa/frtstream/frtstreamTemplateImp.hpp +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -//template functions that must be included in the -//header file, since the full definition needs to be -//available to users. -//Can be moved when(if ever) the export functionality -//is implemented in the target compiler. - -namespace frtstream { - -template<class U> -struct FrtStreamConverter{ - typedef U type; - typedef U serializationType; - - static const serializationType& convertTo(const U& u) { - return u; - } - static const U& convertFrom(const serializationType& s) { - return s; - } - -}; - -//signed conversion -#define _FRTSTREAM_CONVERTUNSIGNED_(signedType) \ -template <> \ -struct FrtStreamConverter< signedType > { \ - typedef u##signedType serializationType; \ -\ - static serializationType convertTo(signedType u) { \ - return static_cast< serializationType >(u); \ - } \ - static signedType convertFrom(serializationType s) { \ - return static_cast< signedType >(s); \ - } \ -}; - -_FRTSTREAM_CONVERTUNSIGNED_(int8_t); -_FRTSTREAM_CONVERTUNSIGNED_(int16_t); -_FRTSTREAM_CONVERTUNSIGNED_(int32_t); -_FRTSTREAM_CONVERTUNSIGNED_(int64_t); - -#undef _FRTSTREAM_CONVERTUNSIGNED_ -//end signed conversion - - -template<class T> -struct FrtArray { - T* _pt; - uint32_t _len; -}; - - -//ArrayTypeUtil - -//Little ugly hack to avoid code duplication -//Needed since template based approach failed -//to work because of anonymous type. -#define _FRTSTREAM_FILLARRAY(arr, prefix) \ -arr._pt = prefix._pt; \ -arr._len = prefix._len; - - -void PleaseAddSpecializationForYourType(); - -template <class SerializationType> -struct ArrayTypeUtil { - template <class Converter, class Cont> - static void addArray(FRT_Values& value, const Cont& c) { - frtstream::PleaseAddSpecializationForYourType(); - } - - static void getArray(FRT_Value& value) { - frtstream::PleaseAddSpecializationForYourType(); - } -}; - -template <> -struct ArrayTypeUtil<std::string> { - template<class Converter> - struct AddString{ - FRT_StringValue* ptr; - FRT_Values& values; - - AddString(FRT_StringValue* start, FRT_Values& val) : - ptr(start), values(val) {} - void operator()(const typename Converter::type& s) { - values.SetString(ptr++, Converter::convertTo(s).c_str()); - } - }; - - - template <class Converter, class Cont> - static void addArray(FRT_Values& value, const Cont& c) { - FRT_StringValue* start = value.AddStringArray(c.size()); - std::for_each(c.begin(), c.end(), AddString<Converter>(start, value)); - - } - static FrtArray<FRT_StringValue> getArray(FRT_Value& value) { - FrtArray<FRT_StringValue> arr; - _FRTSTREAM_FILLARRAY(arr, value._string_array); - return arr; - } - -}; - -#define _FRTSTREAM_ARRAYTYPE_UTIL_FLOAT(floatType, floatTypeCapitalized) \ -template <> \ -struct ArrayTypeUtil<floatType> { \ - template <class Converter, class Cont> \ - static void addArray(FRT_Values& values, const Cont & cont) { \ - floatType* startPtr = values.Add##floatTypeCapitalized##Array(cont.size()); \ - std::transform(cont.begin(), cont.end(), startPtr, Converter::convertTo); \ - } \ - static FrtArray<floatType> getArray(FRT_Value& value) { \ - FrtArray<floatType> arr; \ - _FRTSTREAM_FILLARRAY(arr, value._##floatType##_array); \ - return arr; \ - } \ -}; - -_FRTSTREAM_ARRAYTYPE_UTIL_FLOAT(float, Float); -_FRTSTREAM_ARRAYTYPE_UTIL_FLOAT(double, Double); -#undef _FRTSTREAM_ARRAYTYPE_UTIL_FLOAT - -#define _FRTSTREAM_ARRAYTYPE_UTIL_INT(bits) \ -template <> \ -struct ArrayTypeUtil<uint##bits##_t> { \ - template <class Converter, class Cont> \ - static void addArray(FRT_Values& values, const Cont & cont) { \ - uint##bits##_t* startPtr = values.AddInt##bits##Array(cont.size()); \ - std::transform(cont.begin(), cont.end(), startPtr, \ - Converter::convertTo); \ - } \ -\ - static FrtArray<uint##bits##_t> getArray(FRT_Value& value) { \ - FrtArray<uint##bits##_t> arr; \ - _FRTSTREAM_FILLARRAY(arr, value._int##bits##_array); \ - return arr; \ - } \ -}; - -_FRTSTREAM_ARRAYTYPE_UTIL_INT(8); -_FRTSTREAM_ARRAYTYPE_UTIL_INT(16); -_FRTSTREAM_ARRAYTYPE_UTIL_INT(32); -_FRTSTREAM_ARRAYTYPE_UTIL_INT(64); -#undef _FRTSTREAM_ARRAYTYPE_UTIL_INT - -#undef _FRTSTREAM_FILLARRAY -//End ArrayTypeUtil - -//ArrayReader -template <class T> -struct ArrayReader { - template<class Converter, class Iter, class ArrayImp> - static void read(Iter dest, ArrayImp arr) { - std::transform( arr._pt, arr._pt + arr._len, dest, - Converter::convertFrom ); - - } -}; - -template <> -struct ArrayReader<std::string> { - template<class Converter, class Iter, class ArrayImp> - static void read(Iter dest, ArrayImp arr) { - FRT_StringValue* ptr = arr._pt; - for(uint32_t i = 0; i < arr._len; i++ ) { - *dest++ = Converter::convertFrom(ptr++ ->_str); - } - } -}; - - - -//End ArrayReader - - -template <template<typename, typename> class CONT, class T, class ALLOC> -FrtStream& FrtStream::operator<<( const CONT<T, ALLOC> & cont ) { - typedef FrtStreamConverter<typename CONT<T, ALLOC>::value_type> Converter; - typedef typename FrtStreamConverter<typename CONT<T, ALLOC>::value_type>::serializationType SerializationType; - - frtstream::ArrayTypeUtil<SerializationType>::template addArray<Converter>(in(), cont); - - return *this; -} - - - -template <template<typename, typename> class CONT, class T, class ALLOC> -FrtStream& FrtStream::operator>>( CONT<T, ALLOC> & cont ) { - typedef FrtStreamConverter<typename CONT<T, ALLOC>::value_type> Converter; - typedef typename FrtStreamConverter<typename CONT<T, ALLOC>::value_type>::serializationType SerializationType; - - ArrayReader<SerializationType>::template read<Converter>( std::inserter(cont, cont.end()), - ArrayTypeUtil<SerializationType>::getArray(nextOut()) ); - - return *this; -} - -} //end namespace frtstream |