Points&Forces (core)
Software tools facilitating the task of surveying architecture
a_unit.h
Go to the documentation of this file.
1 /*
2  Copyright 2000-2012 Pierre SMARS (smars@yuntech.edu.tw)
3  This program is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 2 of the License, or
6  (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 #ifndef _UNIT_H_
17 #define _UNIT_H_
18 
19 // .NAME a_unit
20 // .SECTION Author
21 // Pierre Smars
22 
23 #include <iostream>
24 #include <string>
25 #include "a_unit_base.h"
26 
28 class a_unit: public a_unit_base
29 {
30  public:
31  a_unit();
32  a_unit(const a_unit&);
33  a_unit(const std::string n, const std::string ns, double r);
34  virtual const std::string classname() {return "a_unit";};
35  static const std::string help();
36  std::string name() const {return name_;};
37  void name(const std::string name) {name_=name;};
38  std::string short_name() const {return short_name_;};
39  void short_name(const std::string name) {short_name_=name;};
40  double ratio() const {return ratio_;};
41  void ratio(const double ratio) {ratio_=ratio;};
42 
43  //: input/output
44  virtual void read(std::istream &i);
45  virtual void write(std::ostream &o) const;
46 
47  protected:
48  std::string name_;
49  std::string short_name_;
50  double ratio_;
51 };
52 
53 #endif
unit
Definition: a_unit.h:29
virtual void write(std::ostream &o) const
Definition: a_unit.cxx:102
a_unit()
Definition: a_unit.cxx:110
virtual const std::string classname()
Definition: a_unit.h:34
void short_name(const std::string name)
Definition: a_unit.h:39
static const std::string help()
Definition: a_unit.cxx:6
double ratio_
Definition: a_unit.h:50
std::string name_
Definition: a_unit.h:48
void name(const std::string name)
Definition: a_unit.h:37
std::string short_name_
Definition: a_unit.h:49
std::string short_name() const
Definition: a_unit.h:38
std::string name() const
Definition: a_unit.h:36
double ratio() const
Definition: a_unit.h:40
void ratio(const double ratio)
Definition: a_unit.h:41
virtual void read(std::istream &i)
Definition: a_unit.cxx:31