SEGenericScalar.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <biogears/cdm/properties/SEScalar.h>
15 #include <biogears/cdm/properties/SEScalarQuantity.h>
16 
17 namespace biogears {
18 //-------------------------------------------------------------------------------
19 // I created this class for use in connecting DataRequests to SEScalars for the PhysiologyEngineTrack class
25 class BIOGEARS_API SEGenericScalar : public Loggable {
26 public:
27  SEGenericScalar(Logger* logger);
28  virtual ~SEGenericScalar(){};
29 
30  virtual bool HasScalar();
31  virtual void SetScalar(const SEScalar& s);
32 
33  virtual bool IsValid();
34  virtual bool IsInfinity();
35 
36  virtual bool HasUnit();
37  virtual const CCompoundUnit* GetUnit();
38  virtual bool IsValidUnit(const CCompoundUnit& unit) const;
39  virtual const CCompoundUnit* GetCompoundUnit(const char* unit) const;
40  virtual const CCompoundUnit* GetCompoundUnit(const std::string& unit) const;
41 
42  virtual double GetValue() const;
43  virtual double GetValue(const char* unit) const;
44  virtual double GetValue(const std::string& unit) const;
45 
46 protected:
49 };
50 
51 }
Definition: SEScalar.h:33
If you want to querry what a scalar is and don't know what scalar type you have...
Definition: SEGenericScalar.h:25
Definition: Logger.h:27
Definition: Logger.h:75
Definition: CompoundUnit.h:59
const SEScalar * m_Scalar
Definition: SEGenericScalar.h:47
virtual ~SEGenericScalar()
Definition: SEGenericScalar.h:28
const SEUnitScalar * m_UnitScalar
Definition: SEGenericScalar.h:48
Definition: SEUnitScalar.h:18
Definition: SEElectricalCircuit.h:18