Commit cdaaaf02 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'linting'

parents 2348ae49 be6f8c87
Pipeline #375199 passed with stages
in 3 minutes and 2 seconds
......@@ -100,7 +100,7 @@ namespace corryvreckan {
*
* Does nothing if not overloaded.
*/
virtual StatusCode run(Clipboard* clipboard) { (void)clipboard; }
virtual StatusCode run(Clipboard*) { return Success; }
/**
* @brief Finalise the module after the event sequence
......
......@@ -13,7 +13,7 @@ ATLASpixEventLoader::ATLASpixEventLoader(Configuration config, std::vector<Detec
m_inputDirectory = m_config.get<std::string>("inputDirectory");
m_calibrationFile = m_config.get<std::string>("calibrationFile");
m_startTime - m_config.get<double>("startTime", 0.);
m_startTime = m_config.get<double>("startTime", 0.);
m_toaMode = m_config.get<bool>("toaMode", false);
}
......@@ -34,7 +34,7 @@ void ATLASpixEventLoader::initialise() {
dirent* file;
// Read the entries in the folder
while(entry = readdir(directory)) {
while((entry = readdir(directory))) {
// Check for the data file
string filename = m_inputDirectory + "/" + entry->d_name;
if(filename.find(".dat") != string::npos) {
......
......@@ -25,7 +25,7 @@ void CLICpixEventLoader::initialise() {
dirent* file;
// Read the entries in the folder
while(entry = readdir(directory)) {
while((entry = readdir(directory))) {
// Check for the data file
string filename = inputDirectory + "/" + entry->d_name;
if(filename.find(".dat") != string::npos) {
......
......@@ -36,7 +36,7 @@ StatusCode DataDump::run(Clipboard* clipboard) {
bool clearedHeader = false;
// Get all of the files for this chip
while(file = readdir(directory)) {
while((file = readdir(directory))) {
string filename = inputDirectory + "/" + file->d_name;
// Check if file has extension .dat
......
......@@ -49,7 +49,7 @@ void Timepix1EventLoader::initialise() {
dirent* file;
// Read the entries in the folder
while(entry = readdir(directory)) {
while((entry = readdir(directory))) {
// Get the name of this entry
string filename = entry->d_name;
......
......@@ -57,7 +57,7 @@ void Timepix3EventLoader::initialise() {
std::map<std::string, std::vector<std::string>> detector_files;
// Read the entries in the folder
while(entry = readdir(directory)) {
while((entry = readdir(directory))) {
// Ignore UNIX functional directories:
if(std::string(entry->d_name).at(0) == '.') {
......@@ -92,7 +92,7 @@ void Timepix3EventLoader::initialise() {
}
// Get all of the files for this chip
while(file = readdir(dataDir)) {
while((file = readdir(dataDir))) {
string filename = dataDirName + "/" + file->d_name;
// Check if file has extension .dat
......@@ -138,7 +138,6 @@ void Timepix3EventLoader::initialise() {
std::sort(detector_files[detector->name()].begin(),
detector_files[detector->name()].end(),
[](std::string a, std::string b) {
auto get_serial = [](std::string name) {
const auto pos1 = name.find_last_of('-');
const auto pos2 = name.find_last_of('.');
......
......@@ -27,6 +27,7 @@ ROOT_GENERATE_DICTIONARY(CorryvreckanObjectsDictionary
LINKDEF
${CMAKE_CURRENT_SOURCE_DIR}/Linkdef.h
OPTIONS
-Wno-inconsistent-missing-override
-inlineInputHeader
-I${CMAKE_CURRENT_SOURCE_DIR}
MODULE
......
......@@ -9,11 +9,11 @@
using namespace corryvreckan;
Object::Object() : m_detectorID(), m_timestamp(0) {}
Object::Object(std::string detectorID) : m_detectorID(detectorID), m_timestamp(0) {}
Object::Object(double timestamp) : m_detectorID(), m_timestamp(timestamp) {}
Object::Object(std::string detectorID, double timestamp) : m_detectorID(detectorID), m_timestamp(timestamp) {}
Object::~Object() {}
Object::Object() = default;
Object::Object(std::string detectorID) : m_detectorID(std::move(detectorID)) {}
Object::Object(double timestamp) : m_timestamp(timestamp) {}
Object::Object(std::string detectorID, double timestamp) : m_detectorID(std::move(detectorID)), m_timestamp(timestamp) {}
Object::~Object() = default;
// Return class type for fixed object types (that don't depend on detector type)
Object* Object::Factory(std::string objectType, Object* object) {
......@@ -38,5 +38,3 @@ Object* Object::Factory(std::string detectorType, std::string objectType, Object
return new Object();
}
ClassImp(Object)
......@@ -27,16 +27,16 @@ namespace corryvreckan {
* @brief Base class for internal objects
*
* Generic base class. Every class which inherits from Object can be placed on the clipboard and written out to file.
*/
*/
class Object : public TObject {
public:
// Constructors and destructors
Object();
Object(std::string detectorID);
Object(double timestamp);
explicit Object(std::string detectorID);
explicit Object(double timestamp);
Object(std::string detectorID, double timestamp);
virtual ~Object();
~Object() override;
// Methods to get member variables
std::string getDetectorID() { return m_detectorID; }
......@@ -47,24 +47,23 @@ namespace corryvreckan {
void setTimestamp(double time) { timestamp(time); }
// Methods to set member variables
void setDetectorID(std::string detectorID) { m_detectorID = detectorID; }
void setDetectorID(std::string detectorID) { m_detectorID = std::move(detectorID); }
// Function to get instantiation of inherited class (given a string, give back
// an object of type 'daughter')
// Function to get instantiation of inherited class (given a string, give back an object of type 'daughter')
static Object* Factory(std::string, Object* object = NULL);
static Object* Factory(std::string, std::string, Object* object = NULL);
protected:
// Member variables
std::string m_detectorID;
double m_timestamp;
double m_timestamp{0};
// ROOT I/O class definition - update version number when you change this class!
ClassDef(Object, 1)
ClassDefOverride(Object, 2)
};
// Vector type declaration
typedef std::vector<Object*> Objects;
using Objects = std::vector<Object*>;
} // namespace corryvreckan
#endif // CORRYVRECKAN_OBJECT_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment