mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 18:11:49 +00:00
Fix copy constructor & assignment operator warning in FairMQChannel
Fix Weffc++ warnings - Add missing copy constructors and assignment operators . - Hide the warning from FairMQStateMachine.h where it is produced by boost and/or is intended. - Some code cleanup.
This commit is contained in:
committed by
Florian Uhlig
parent
9a0a8c7516
commit
e4fed2fa1b
@@ -6,34 +6,28 @@
|
||||
*/
|
||||
|
||||
#ifndef BASEDESERIALIZATIONPOLICY_H
|
||||
#define BASEDESERIALIZATIONPOLICY_H
|
||||
|
||||
#define BASEDESERIALIZATIONPOLICY_H
|
||||
|
||||
#include "FairMQMessage.h"
|
||||
|
||||
// c++11 code
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
|
||||
// CRTP base class
|
||||
template <typename TDerived >
|
||||
class BaseDeserializationPolicy
|
||||
{
|
||||
public:
|
||||
BaseDeserializationPolicy()
|
||||
{}
|
||||
public:
|
||||
BaseDeserializationPolicy() {}
|
||||
|
||||
virtual ~BaseDeserializationPolicy()
|
||||
{}
|
||||
virtual ~BaseDeserializationPolicy() {}
|
||||
|
||||
template<typename C = TDerived>
|
||||
auto DeserializeMsg(FairMQMessage* msg)-> decltype(static_cast<C*>(this)->DeserializeMsg(msg) )
|
||||
auto DeserializeMsg(FairMQMessage* msg)-> decltype(static_cast<C*>(this)->DeserializeMsg(msg))
|
||||
{
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseDeserializationPolicy::DeserializeMsg hack broken");
|
||||
return static_cast<TDerived*>(this)->DeserializeMsg(msg);
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseDeserializationPolicy::DeserializeMsg hack broken");
|
||||
return static_cast<TDerived*>(this)->DeserializeMsg(msg);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -57,5 +51,4 @@ public:
|
||||
|
||||
};*/
|
||||
|
||||
#endif /* BASEDESERIALIZATIONPOLICY_H */
|
||||
|
||||
#endif /* BASEDESERIALIZATIONPOLICY_H */
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#ifndef BASEPROCESSORTASKPOLICY_H
|
||||
#define BASEPROCESSORTASKPOLICY_H
|
||||
#define BASEPROCESSORTASKPOLICY_H
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
@@ -14,31 +14,27 @@
|
||||
template <typename TDerived >
|
||||
class BaseProcessorTaskPolicy
|
||||
{
|
||||
public:
|
||||
BaseProcessorTaskPolicy()
|
||||
{}
|
||||
public:
|
||||
BaseProcessorTaskPolicy() {}
|
||||
|
||||
virtual ~BaseProcessorTaskPolicy()
|
||||
{}
|
||||
virtual ~BaseProcessorTaskPolicy() {}
|
||||
|
||||
template<typename C = TDerived>
|
||||
auto GetOutputData() -> decltype(static_cast<C*>(this)->GetOutputData() )
|
||||
auto GetOutputData() -> decltype(static_cast<C*>(this)->GetOutputData())
|
||||
{
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseProcessorTaskPolicy::GetOutputData hack broken");
|
||||
return static_cast<TDerived*>(this)->GetOutputData();
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseProcessorTaskPolicy::GetOutputData hack broken");
|
||||
return static_cast<TDerived*>(this)->GetOutputData();
|
||||
}
|
||||
|
||||
template<typename CONTAINER_TYPE, typename C = TDerived>
|
||||
auto ExecuteTask(CONTAINER_TYPE container) -> decltype( static_cast<C*>(this)->ExecuteTask(container) )
|
||||
auto ExecuteTask(CONTAINER_TYPE container) -> decltype( static_cast<C*>(this)->ExecuteTask(container))
|
||||
{
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseProcessorTaskPolicy::ExecuteTask hack broken");
|
||||
return static_cast<TDerived*>(this)->ExecuteTask(container);
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseProcessorTaskPolicy::ExecuteTask hack broken");
|
||||
return static_cast<TDerived*>(this)->ExecuteTask(container);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
// c++14 code only
|
||||
// CRTP base class
|
||||
@@ -65,5 +61,5 @@ public:
|
||||
|
||||
};
|
||||
*/
|
||||
#endif /* BASEPROCESSORTASKPOLICY_H */
|
||||
|
||||
#endif /* BASEPROCESSORTASKPOLICY_H */
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#ifndef BASESERIALIZATIONPOLICY_H
|
||||
#define BASESERIALIZATIONPOLICY_H
|
||||
#define BASESERIALIZATIONPOLICY_H
|
||||
|
||||
#include "FairMQMessage.h"
|
||||
|
||||
@@ -15,12 +15,10 @@
|
||||
template <typename TDerived >
|
||||
class BaseSerializationPolicy
|
||||
{
|
||||
public:
|
||||
BaseSerializationPolicy()
|
||||
{}
|
||||
public:
|
||||
BaseSerializationPolicy() {}
|
||||
|
||||
virtual ~BaseSerializationPolicy()
|
||||
{}
|
||||
virtual ~BaseSerializationPolicy() {}
|
||||
|
||||
template<typename CONTAINER_TYPE, typename C = TDerived>
|
||||
auto SerializeMsg(CONTAINER_TYPE container) -> decltype(static_cast<C*>(this)->SerializeMsg(container) )
|
||||
@@ -35,10 +33,9 @@ public:
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseSerializationPolicy::SetMessage hack broken");
|
||||
return static_cast<TDerived*>(this)->SetMessage(msg);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
/*
|
||||
// CRTP base class
|
||||
// c++14 code
|
||||
template <typename TDerived >
|
||||
@@ -64,5 +61,5 @@ public:
|
||||
|
||||
};
|
||||
*/
|
||||
#endif /* BASESERIALIZATIONPOLICY_H */
|
||||
|
||||
#endif /* BASESERIALIZATIONPOLICY_H */
|
||||
|
@@ -6,20 +6,18 @@
|
||||
*/
|
||||
|
||||
#ifndef BASESINKPOLICY_H
|
||||
#define BASESINKPOLICY_H
|
||||
|
||||
#define BASESINKPOLICY_H
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
// CRTP base class
|
||||
template <typename TDerived >
|
||||
class BaseSinkPolicy
|
||||
{
|
||||
public:
|
||||
BaseSinkPolicy()
|
||||
{}
|
||||
public:
|
||||
BaseSinkPolicy() {}
|
||||
|
||||
virtual ~BaseSinkPolicy()
|
||||
{}
|
||||
virtual ~BaseSinkPolicy() {}
|
||||
|
||||
template<typename CONTAINER_TYPE, typename C = TDerived>
|
||||
auto AddToFile(CONTAINER_TYPE container) -> decltype(static_cast<C*>(this)->AddToFile(container) )
|
||||
@@ -34,8 +32,6 @@ public:
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseSinkPolicy::InitOutputFile hack broken");
|
||||
return static_cast<TDerived*>(this)->InitOutputFile();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif /* BASESINKPOLICY_H */
|
||||
|
||||
#endif /* BASESINKPOLICY_H */
|
||||
|
@@ -6,20 +6,19 @@
|
||||
*/
|
||||
|
||||
#ifndef BASESOURCEPOLICY_H
|
||||
#define BASESOURCEPOLICY_H
|
||||
#define BASESOURCEPOLICY_H
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
// c++11 code
|
||||
// CRTP base class
|
||||
template <typename TDerived >
|
||||
class BaseSourcePolicy
|
||||
{
|
||||
public:
|
||||
BaseSourcePolicy()
|
||||
{}
|
||||
public:
|
||||
BaseSourcePolicy() {}
|
||||
|
||||
virtual ~BaseSourcePolicy()
|
||||
{}
|
||||
virtual ~BaseSourcePolicy() {}
|
||||
|
||||
template<typename C = TDerived>
|
||||
auto InitSource()-> decltype(static_cast<C*>(this)->InitSource() )
|
||||
@@ -49,7 +48,6 @@ public:
|
||||
static_assert(std::is_same<C, TDerived>{}, "BaseSourcePolicy::GetOutData hack broken");
|
||||
return static_cast<TDerived*>(this)->GetOutData();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -87,5 +85,5 @@ public:
|
||||
|
||||
};
|
||||
*/
|
||||
#endif /* BASESOURCEPOLICY_H */
|
||||
|
||||
#endif /* BASESOURCEPOLICY_H */
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#ifndef GENERICMERGER_H
|
||||
#define GENERICMERGER_H
|
||||
#define GENERICMERGER_H
|
||||
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
@@ -72,4 +72,3 @@ class GenericMerger : public FairMQDevice, public MergerPolicy, public InputPoli
|
||||
};
|
||||
|
||||
#endif /* GENERICMERGER_H */
|
||||
|
||||
|
@@ -13,6 +13,7 @@ base_GenericSampler<T,U,K,L>::base_GenericSampler()
|
||||
, fEventRate(1)
|
||||
, fEventCounter(0)
|
||||
, fContinuous(false)
|
||||
, fTaskList()
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user