SEDecimalFormat.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/CommonDataModel.h>
15 #include <biogears/exports.h>
16 
17 CDM_BIND_DECL(DecimalFormatData)
18 
19 namespace biogears {
20 
21 enum class DecimalNotation { Default,
22  Fixed,
23  Scientific };
24 
25 class BIOGEARS_API SEDecimalFormat {
26 public:
27  SEDecimalFormat(const SEDecimalFormat* dfault = nullptr);
28  virtual ~SEDecimalFormat();
29 
30  virtual void Reset();
31  virtual void Set(const SEDecimalFormat& f);
32 
33  virtual bool Load(const CDM::DecimalFormatData& in);
34  virtual CDM::DecimalFormatData* Unload();
35 
36 protected:
37  virtual void Unload(CDM::DecimalFormatData& to) const;
38 
39 public:
40  void SetPrecision(std::streamsize p);
41  std::streamsize GetPrecision();
42 
43  void SetNotation(DecimalNotation n);
44  DecimalNotation GetNotation();
45 
46  void SetStream(std::ofstream& s);
47 
48 protected:
49  std::streamsize m_Precision;
51 };
52 }
DecimalNotation
Definition: SEDecimalFormat.h:21
std::streamsize m_Precision
Definition: SEDecimalFormat.h:49
DecimalNotation m_Notation
Definition: SEDecimalFormat.h:50
Definition: SEDecimalFormat.h:25
Definition: SEElectricalCircuit.h:18
Class corresponding to the DecimalFormatData schema type.
Definition: Properties.hxx:1182