Skip to content

Commit

Permalink
Merge branch 'cms-sw:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-mormile authored Dec 7, 2023
2 parents 8662727 + 754d4fb commit 9309b54
Show file tree
Hide file tree
Showing 201 changed files with 3,681 additions and 1,238 deletions.
14 changes: 0 additions & 14 deletions Alignment/Geners/interface/CPP11_auto_ptr.hh

This file was deleted.

6 changes: 3 additions & 3 deletions Alignment/Geners/interface/CStringStream.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <iostream>
#include <vector>

#include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
#include <memory>
#include "Alignment/Geners/interface/CStringBuf.hh"
#include "Alignment/Geners/interface/ZlibHandle.hh"

Expand Down Expand Up @@ -76,8 +76,8 @@ namespace gs {
std::vector<char> comprBuf_;
std::vector<char> readBuf_;
std::ostream *sink_;
CPP11_auto_ptr<ZlibInflateHandle> inflator_;
CPP11_auto_ptr<ZlibDeflateHandle> deflator_;
std::unique_ptr<ZlibInflateHandle> inflator_;
std::unique_ptr<ZlibDeflateHandle> deflator_;
};
} // namespace gs

Expand Down
4 changes: 2 additions & 2 deletions Alignment/Geners/interface/CompressedIO.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace gs {
void restore_compressed_item(std::istream &in, Item *item);

template <class Item>
CPP11_auto_ptr<Item> read_compressed_item(std::istream &in);
std::unique_ptr<Item> read_compressed_item(std::istream &in);
} // namespace gs

namespace gs {
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace gs {
}

template <class Item>
inline CPP11_auto_ptr<Item> read_compressed_item(std::istream &is) {
inline std::unique_ptr<Item> read_compressed_item(std::istream &is) {
long long len;
read_pod(is, &len);
unsigned compressionCode;
Expand Down
24 changes: 13 additions & 11 deletions Alignment/Geners/interface/GenericIO.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef GENERS_GENERICIO_HH_
#define GENERS_GENERICIO_HH_

#include <memory>

#include "Alignment/Geners/interface/IOPointeeType.hh"
#include "Alignment/Geners/interface/binaryIO.hh"

Expand Down Expand Up @@ -51,13 +53,13 @@ namespace gs {
// from std::exception.
*/
template <class Item, class Stream>
inline CPP11_auto_ptr<Item> read_item(Stream &is, const bool readClassId = true) {
inline std::unique_ptr<Item> read_item(Stream &is, const bool readClassId = true) {
typedef std::vector<ClassId> State;
Item *item = nullptr;
State state;
const bool status = GenericReader<Stream, State, Item *, Int2Type<IOTraits<int>::ISNULLPOINTER>>::process(
item, is, &state, readClassId);
CPP11_auto_ptr<Item> ptr(item);
std::unique_ptr<Item> ptr(item);
if (is.fail())
throw IOReadFailure("In gs::read_item: input stream failure");
if (!status || item == nullptr)
Expand Down Expand Up @@ -150,9 +152,9 @@ namespace gs {
template <class Stream, class State, class T>
struct GenericReader<Stream, State, T, Int2Type<IOTraits<int>::ISPOD>> {
inline static bool readIntoPtr(T *&ptr, Stream &str, State *, const bool processClassId) {
CPP11_auto_ptr<T> myptr;
std::unique_ptr<T> myptr;
if (ptr == nullptr)
myptr = CPP11_auto_ptr<T>(new T());
myptr = std::unique_ptr<T>(new T());
if (processClassId) {
static const ClassId current(ClassId::makeId<T>());
ClassId id(str, 1);
Expand Down Expand Up @@ -441,9 +443,9 @@ namespace gs {
template <class Stream, class State, class T>
struct GenericReader<Stream, State, T, Int2Type<IOTraits<int>::ISPAIR>> {
inline static bool readIntoPtr(T *&ptr, Stream &str, State *s, const bool processClassId) {
CPP11_auto_ptr<T> myptr;
std::unique_ptr<T> myptr;
if (ptr == 0) {
myptr = CPP11_auto_ptr<T>(new T());
myptr = std::unique_ptr<T>(new T());
clearIfPointer(myptr.get()->first);
clearIfPointer(myptr.get()->second);
}
Expand Down Expand Up @@ -499,9 +501,9 @@ namespace gs {
template <class Stream, class State>
struct GenericReader<Stream, State, std::string, Int2Type<IOTraits<int>::ISSTRING>> {
inline static bool readIntoPtr(std::string *&ptr, Stream &is, State *, const bool processClassId) {
CPP11_auto_ptr<std::string> myptr;
std::unique_ptr<std::string> myptr;
if (ptr == nullptr)
myptr = CPP11_auto_ptr<std::string>(new std::string());
myptr = std::make_unique<std::string>();
if (processClassId) {
static const ClassId current(ClassId::makeId<std::string>());
ClassId id(is, 1);
Expand Down Expand Up @@ -613,7 +615,7 @@ namespace gs {
if (ptr)
return process_item<GenericReader2>(*ptr, str, s, processClassId);
else {
CPP11_auto_ptr<T> myptr(new T());
std::unique_ptr<T> myptr(new T());
if (!process_item<GenericReader2>(*myptr, str, s, processClassId))
return false;
ptr = myptr.release();
Expand Down Expand Up @@ -673,9 +675,9 @@ namespace gs {
template <class Stream, class State, class T>
struct GenericReader<Stream, State, T, Int2Type<IOTraits<int>::ISPLACEREADABLE>> {
inline static bool readIntoPtr(T *&ptr, Stream &str, State *s, const bool processClassId) {
CPP11_auto_ptr<T> myptr;
std::unique_ptr<T> myptr;
if (ptr == 0)
myptr = CPP11_auto_ptr<T>(new T());
myptr = std::unique_ptr<T>(new T());
if (processClassId) {
ClassId id(str, 1);
T::restore(id, str, ptr ? ptr : myptr.get());
Expand Down
8 changes: 4 additions & 4 deletions Alignment/Geners/interface/Reference.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define GENERS_REFERENCE_HH_

#include "Alignment/Geners/interface/AbsReference.hh"
#include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
#include <memory>

#include <memory>

Expand Down Expand Up @@ -32,7 +32,7 @@ namespace gs {

// Methods to retrieve the item
void restore(unsigned long index, T *obj) const;
CPP11_auto_ptr<T> get(unsigned long index) const;
std::unique_ptr<T> get(unsigned long index) const;
std::shared_ptr<T> getShared(unsigned long index) const;

Reference() = delete;
Expand Down Expand Up @@ -73,8 +73,8 @@ namespace gs {
}

template <typename T>
inline CPP11_auto_ptr<T> Reference<T>::get(const unsigned long index) const {
return CPP11_auto_ptr<T>(getPtr(index));
inline std::unique_ptr<T> Reference<T>::get(const unsigned long index) const {
return std::unique_ptr<T>(getPtr(index));
}

template <typename T>
Expand Down
4 changes: 2 additions & 2 deletions Alignment/Geners/interface/WriteOnlyCatalog.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <iostream>

#include "Alignment/Geners/interface/AbsCatalog.hh"
#include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
#include <memory>

namespace gs {
class WriteOnlyCatalog : public AbsCatalog {
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace gs {
unsigned long long count_;
unsigned long long smallestId_;
unsigned long long largestId_;
CPP11_auto_ptr<const CatalogEntry> lastEntry_;
std::unique_ptr<const CatalogEntry> lastEntry_;
};
} // namespace gs

Expand Down
12 changes: 6 additions & 6 deletions Alignment/Geners/interface/binaryIO.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef GENERS_BINARYIO_HH_
#define GENERS_BINARYIO_HH_

#include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
#include <memory>
#include "Alignment/Geners/interface/ClassId.hh"
#include "Alignment/Geners/interface/IOException.hh"

Expand Down Expand Up @@ -143,9 +143,9 @@ namespace gs {
}

template <typename T>
inline CPP11_auto_ptr<T> read_obj(std::istream &in) {
inline std::unique_ptr<T> read_obj(std::istream &in) {
const ClassId id(in, 1);
return CPP11_auto_ptr<T>(T::read(id, in));
return std::unique_ptr<T>(T::read(id, in));
}

template <typename T>
Expand All @@ -157,10 +157,10 @@ namespace gs {

// The following function is templated upon the reader factory
template <typename Reader>
inline CPP11_auto_ptr<typename Reader::value_type> read_base_obj(std::istream &in, const Reader &f) {
inline std::unique_ptr<typename Reader::value_type> read_base_obj(std::istream &in, const Reader &f) {
typedef typename Reader::value_type T;
const ClassId id(in, 1);
return CPP11_auto_ptr<T>(f.read(id, in));
return std::unique_ptr<T>(f.read(id, in));
}

// The following function assumes that the array contains actual
Expand Down Expand Up @@ -279,7 +279,7 @@ namespace gs {
const ClassId id(in, 1);
pv->reserve(vlen);
for (unsigned long i = 0; i < vlen; ++i) {
CPP11_auto_ptr<T> obj(T::read(id, in));
std::unique_ptr<T> obj(T::read(id, in));
pv->push_back(*obj);
}
}
Expand Down
Loading

0 comments on commit 9309b54

Please sign in to comment.