DPsim
TopologicalSignalComp.h
1 /* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2  * EONERC, RWTH Aachen University
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7  *********************************************************************************/
8 
9 #pragma once
10 
11 #include <dpsim-models/IdentifiedObject.h>
12 #include <dpsim-models/MathUtils.h>
13 #include <dpsim-models/PtrFactory.h>
14 
15 namespace CPS {
19 protected:
21  Logger::Log mSLog;
23  Logger::Level mLogLevel;
24 
25 public:
26  typedef std::shared_ptr<TopologicalSignalComp> Ptr;
27  typedef std::vector<Ptr> List;
28 
30  TopologicalSignalComp(String uid, String name,
31  Logger::Level logLevel = Logger::Level::off)
32  : IdentifiedObject(uid, name),
33  /* We also want to set the CLI loglevel according to the logLevel
34  * std::max(Logger::Level::info, logLevel). But because of excessive
35  * logging to Level::info that is currently infeasible. */
36  mSLog(Logger::get(name, logLevel, Logger::Level::warn)),
37  mLogLevel(logLevel) {}
38 
40  TopologicalSignalComp(String name,
41  Logger::Level logLevel = Logger::Level::off)
42  : TopologicalSignalComp(name, name, logLevel) {}
44  virtual ~TopologicalSignalComp() {}
45 };
46 } // namespace CPS
String uid()
Returns unique id.
TopologicalSignalComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Basic constructor that takes UID, name and log level.
TopologicalSignalComp(String name, Logger::Level logLevel=Logger::Level::off)
Basic constructor that takes name and log level and sets the UID to name as well.
Logger::Level mLogLevel
Component logger control for internal variables.
Logger::Log mSLog
Component logger.