MotionLib  1.0.0
SamBuCa motion library
PlatformFactory.hpp
1 /*
2  * Copyright (C) 2021 CERN
3  *
4  * This software is provided 'as-is', without any express or implied
5  * warranty. In no event will the authors be held liable for any damages
6  * arising from the use of this software.
7  *
8  * Permission is granted to anyone to use this software for any purpose,
9  * including commercial applications, and to alter it and redistribute it
10  * freely, subject to the following restrictions:
11  *
12  * 1. The origin of this software must not be misrepresented; you must not
13  * claim that you wrote the original software. If you use this software
14  * in a product, an acknowledgment in the product documentation would be
15  * appreciated but is not required.
16  * 2. Altered source versions must be plainly marked as such, and must not be
17  * misrepresented as being the original software.
18  * 3. This notice may not be removed or altered from any source distribution.
19  *
20  * Created on: 2021-10-29
21  * Author: Michal Mysior <mmysior> <michal.mysior@cern.ch>
22  *
23  */
24 
25 #ifndef PLATFORM_FACTORY_HPP__
26 #define PLATFORM_FACTORY_HPP__
27 
28 #include <cstdint>
29 #include <list>
30 #include <memory>
31 #include <mutex>
32 #include <string>
33 #include <vector>
34 
35 #include <ccut/yml.hpp>
36 
37 #include "PlatformBase.hpp"
38 #include "device/DeviceBase.hpp"
39 
40 namespace smc {
41 namespace internal {
48 {
49 public:
50  virtual ~PlatformFactory();
51 
60  std::size_t buildPlatforms(const std::string &platformDesc);
61  std::size_t buildPlatforms(const ccut::yml::NodeRef &platformsNode,
62  const ccut::yml::Parser *parser = nullptr);
63 
70  std::list<PlatformBase::Shared> getPlatforms();
71 
72 protected:
73  std::list<PlatformBase::Shared> m_platforms;
74  mutable std::mutex m_platformsMutex;
75 };
76 
79 } /* namespace internal */
80 } /* namespace smc */
81 
82 #endif /* PLATFORM_FACTORY_HPP__ */
std::list< PlatformBase::Shared > getPlatforms()
Get the platforms list.
std::size_t buildPlatforms(const std::string &platformDesc)
Build platforms according to provided description.
main motion-lib namespace
Definition: Client.cpp:30