diff --git a/Alignment/Geners/interface/ArchiveRecord.hh b/Alignment/Geners/interface/ArchiveRecord.hh deleted file mode 100644 index b91e884290860..0000000000000 --- a/Alignment/Geners/interface/ArchiveRecord.hh +++ /dev/null @@ -1,104 +0,0 @@ -// Standard archive records for single stand-alone objects and simple arrays - -#ifndef GENERS_ARCHIVERECORD_HH_ -#define GENERS_ARCHIVERECORD_HH_ - -#include "Alignment/Geners/interface/AbsRecord.hh" -#include "Alignment/Geners/interface/ArrayAdaptor.hh" -#include "Alignment/Geners/interface/IOIsAnyPtr.hh" - -#include "Alignment/Geners/interface/GenericIO.hh" - -#include -#include - -namespace gs { - template - class ArchiveRecord : public AbsRecord - { - public: - ArchiveRecord(const T& object, const char* name, const char* category) - : AbsRecord(ClassId::makeId(), "gs::Single", name, category), - obj_(object) - { - // Can not store pointer types explicitly -- there is no good way - // to retrieve them - static_assert((!IOIsAnyPtr::value), "can not use archive records with pointers"); - } - - private: - ArchiveRecord(); - - inline virtual bool writeData(std::ostream& os) const - {return write_item(os, obj_, true);} - - const T& obj_; - }; - - - template - class ArchiveRecord > : public AbsRecord - { - public: - ArchiveRecord(const ArrayAdaptor& arr, - const char* name, const char* category) - : AbsRecord(ClassId::makeId(), "gs::Array", name, category), - obj_(arr) {} - - private: - ArchiveRecord(); - - inline virtual bool writeData(std::ostream& os) const - {return write_array(os, obj_.begin(), obj_.size());} - - ArrayAdaptor obj_; - }; - - - // The following record makes a copy of the object instead of just - // storing a reference to it. Naturally, the template parameter type - // must have a copy constructor. - template - class ArchiveValueRecord : public AbsRecord - { - public: - ArchiveValueRecord(const T& object, - const char* name, const char* category) - : AbsRecord(ClassId::makeId(), "gs::Single", name, category), - obj_(new T(object)) - { - // Can not store pointer types explicitly -- there is no good way - // to retrieve them - static_assert((!IOIsAnyPtr::value), "can not use archive records with pointers"); - } - - private: - ArchiveValueRecord(); - - inline virtual bool writeData(std::ostream& os) const - {return write_item(os, *obj_, true);} - - std::shared_ptr obj_; - }; - - - template - class ArchiveValueRecord > : public AbsRecord - { - public: - ArchiveValueRecord(const ArrayAdaptor& arr, - const char* name, const char* category) - : AbsRecord(ClassId::makeId(), "gs::Array", name, category), - obj_(new std::vector(arr.begin(), arr.end())) {} - - private: - ArchiveValueRecord(); - - inline virtual bool writeData(std::ostream& os) const - {return write_array(os, obj_->begin(), obj_->size());} - - std::shared_ptr > obj_; - }; -} - -#endif // GENERS_ARCHIVERECORD_HH_ diff --git a/Alignment/Geners/interface/ArrayRecord.hh b/Alignment/Geners/interface/ArrayRecord.hh deleted file mode 100644 index 6be4075a2ab7c..0000000000000 --- a/Alignment/Geners/interface/ArrayRecord.hh +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef GENERS_ARRAYRECORD_HH_ -#define GENERS_ARRAYRECORD_HH_ - -#include "Alignment/Geners/interface/ArchiveRecord.hh" -#include "Alignment/Geners/interface/ArrayAdaptor.hh" - -namespace gs { - template - inline ArchiveRecord > ArrayRecord( - const T* arr, const std::size_t sz, - const char* name, const char* category) - { - return ArchiveRecord >( - ArrayAdaptor(arr, sz), name, category); - } -} - -#endif // GENERS_ARRAYRECORD_HH_ - diff --git a/Alignment/Geners/interface/Record.hh b/Alignment/Geners/interface/Record.hh deleted file mode 100644 index 66c4aa622671e..0000000000000 --- a/Alignment/Geners/interface/Record.hh +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef GENERS_RECORD_HH_ -#define GENERS_RECORD_HH_ - -#include "Alignment/Geners/interface/ArchiveRecord.hh" - -namespace gs { - template - inline ArchiveRecord Record(const T& object, const char* name, - const char* category) - { - return ArchiveRecord(object, name, category); - } - -#ifndef SWIG - template - inline ArchiveRecord Record(const T& object, const std::string& name, - const char* category) - { - return ArchiveRecord(object, name.c_str(), category); - } - - template - inline ArchiveRecord Record(const T& object, const char* name, - const std::string& category) - { - return ArchiveRecord(object, name, category.c_str()); - } - - template - inline ArchiveRecord Record(const T& object, const std::string& name, - const std::string& category) - { - return ArchiveRecord(object, name.c_str(), category.c_str()); - } -#endif - - // - // ValueRecord makes a copy of the object and stores it internally - // - template - inline ArchiveValueRecord ValueRecord(const T& object, const char* name, - const char* category) - { - return ArchiveValueRecord(object, name, category); - } - -#ifndef SWIG - template - inline ArchiveValueRecord ValueRecord(const T& object, - const std::string& name, - const char* category) - { - return ArchiveValueRecord(object, name.c_str(), category); - } - - template - inline ArchiveValueRecord ValueRecord(const T& object, const char* name, - const std::string& category) - { - return ArchiveValueRecord(object, name, category.c_str()); - } - - template - inline ArchiveValueRecord ValueRecord(const T& object, - const std::string& name, - const std::string& category) - { - return ArchiveValueRecord(object, name.c_str(), category.c_str()); - } -#endif -} - -#endif // GENERS_RECORD_HH_ -