File indexing completed on 2026-06-02 08:51:43
0001 #ifndef RESULT_H
0002 #define RESULT_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <ElementaryUtils/string_utils/Formatter.h>
0012 #include <string>
0013
0014 #include "channel/ChannelType.h"
0015 #include "system/ResultInfo.h"
0016
0017 namespace PARTONS {
0018
0019
0020
0021
0022
0023
0024
0025
0026 template<typename KinematicType>
0027 class Result: public BaseObject {
0028
0029 public:
0030
0031
0032
0033
0034 virtual ~Result() {
0035 }
0036
0037 virtual std::string toString() const {
0038
0039 ElemUtils::Formatter formatter;
0040
0041 formatter << BaseObject::toString() << " ChannelType: "
0042 << ChannelType(m_channelType).toString()
0043 << " ComputationModuleName: " << m_computationModuleName
0044 << " IndexId: " << getIndexId() << "\n\n";
0045 formatter << "Kinematics: " << m_kinematic.toString();
0046
0047 return formatter.str();
0048 }
0049
0050
0051
0052
0053
0054
0055
0056 bool operator <(const Result<KinematicType> &other) const {
0057 return (m_kinematic < other.m_kinematic);
0058 }
0059
0060
0061
0062
0063
0064
0065
0066
0067 ChannelType::Type getChannelType() const {
0068 return m_channelType;
0069 }
0070
0071
0072
0073
0074 void setComputationModuleName(const std::string& moduleName) {
0075 m_computationModuleName = moduleName;
0076 }
0077
0078
0079
0080
0081 const std::string& getComputationModuleName() const {
0082 return m_computationModuleName;
0083 }
0084
0085
0086
0087
0088 void setResultInfo(const ResultInfo& resultInfo) {
0089 m_resultInfo = resultInfo;
0090 }
0091
0092
0093
0094
0095 const ResultInfo& getResultInfo() const {
0096 return m_resultInfo;
0097 }
0098
0099
0100
0101
0102 void setKinematic(const KinematicType& kinematic) {
0103 m_kinematic = kinematic;
0104 }
0105
0106
0107
0108
0109 const KinematicType& getKinematic() const {
0110 return m_kinematic;
0111 }
0112
0113 protected:
0114
0115
0116
0117
0118
0119
0120 Result(const std::string &className, ChannelType::Type channelType) :
0121 BaseObject(className), m_channelType(channelType), m_computationModuleName(
0122 "UNDEFINED") {
0123 }
0124
0125
0126
0127
0128
0129 Result(const std::string &className, ChannelType::Type channelType,
0130 const KinematicType& kinematic) :
0131 BaseObject(className), m_channelType(channelType), m_computationModuleName(
0132 "UNDEFINED"), m_kinematic(kinematic) {
0133 }
0134
0135
0136
0137
0138
0139 Result(const Result &other) :
0140 BaseObject(other), m_channelType(other.m_channelType), m_computationModuleName(
0141 other.m_computationModuleName), m_resultInfo(
0142 other.m_resultInfo), m_kinematic(other.m_kinematic) {
0143 }
0144
0145
0146
0147
0148 ChannelType::Type m_channelType;
0149
0150
0151
0152
0153 std::string m_computationModuleName;
0154
0155
0156
0157
0158 ResultInfo m_resultInfo;
0159
0160
0161
0162
0163 KinematicType m_kinematic;
0164 };
0165
0166 }
0167
0168 #endif