diff --git a/scheduler/CMakeLists.txt b/scheduler/CMakeLists.txt index d5d9fa29f4cc9f7843a16c7ce36e0fe7360e77bc..b3aece6dc2b85459121ae6084a8cea334abd2b09 100644 --- a/scheduler/CMakeLists.txt +++ b/scheduler/CMakeLists.txt @@ -59,4 +59,10 @@ add_library (ctamockschedulerdb MockSchedulerDatabase.cpp) target_link_libraries(ctamockschedulerdb - ctascedhuler) + ctascheduler) + +add_library (ctaschedulertest SHARED + SchedulerFactory.cpp) + +target_link_libraries(ctaschedulertest + ctamockschedulerdb) diff --git a/scheduler/SchedulerFactory.cpp b/scheduler/SchedulerFactory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f3ef1a50da1773816611213ebe818e404f42f592 --- /dev/null +++ b/scheduler/SchedulerFactory.cpp @@ -0,0 +1,25 @@ +/* + * The CERN Tape Archive (CTA) project + * Copyright (C) 2015 CERN + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "scheduler/SchedulerFactory.hpp" + +//------------------------------------------------------------------------------ +// destructor +//------------------------------------------------------------------------------ +cta::SchedulerFactory::~SchedulerFactory() throw() { +} diff --git a/scheduler/SchedulerFactory.hpp b/scheduler/SchedulerFactory.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cc6a2b9aaab43514865577fcc36bae252c4d5f06 --- /dev/null +++ b/scheduler/SchedulerFactory.hpp @@ -0,0 +1,48 @@ +/* + * The CERN Tape Archive (CTA) project + * Copyright (C) 2015 CERN + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include <memory> + +namespace cta { + +// Forward declarations for opaque references. +class Scheduler; + +/** + * Asbtract class specifying the interface to a factory of scheduler objects. + */ +class SchedulerFactory { +public: + + /** + * Destructor. + */ + virtual ~SchedulerFactory() throw() = 0; + + /** + * Returns a newly created scheduler object. + * + * @return A newly created scheduler object. + */ + virtual std::auto_ptr<Scheduler *> create() = 0; + +}; // class SchedulerFactory + +} // namespace cta