Shiokaze Framework
A research-oriented fluid solver for computer graphics
credit.h
Go to the documentation of this file.
1 /*
2 ** credit.h
3 **
4 ** This is part of Shiokaze, a research-oriented fluid solver for computer graphics.
5 ** Created by Ryoichi Ando <rand@nii.ac.jp> on Aug 29, 2017.
6 **
7 ** Permission is hereby granted, free of charge, to any person obtaining a copy of
8 ** this software and associated documentation files (the "Software"), to deal in
9 ** the Software without restriction, including without limitation the rights to use,
10 ** copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 ** Software, and to permit persons to whom the Software is furnished to do so,
12 ** subject to the following conditions:
13 **
14 ** The above copyright notice and this permission notice shall be included in all copies
15 ** or substantial portions of the Software.
16 **
17 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 ** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 ** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 ** HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 ** CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 ** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
25 //
26 #ifndef SHKZ_CREDIT_H
27 #define SHKZ_CREDIT_H
28 //
29 #include <shiokaze/core/common.h>
30 #include <string>
31 #include <tuple>
32 //
34 //
37 #define LONG_NAME(long_name) virtual std::string get_name() const override { return credit::m_name.empty() ? long_name : credit::m_name; }
38 #define ARGUMENT_NAME(argument_name) virtual std::string get_argument_name() const override { return credit::m_argument_name.empty() ? argument_name : credit::m_argument_name; }
41 #define AUTHOR_NAME(author_name) virtual std::string get_author() const override { return author_name; }
44 //
47 class credit {
48 public:
53  credit() = default;
62  credit( std::string name, std::string argument_name ) : m_name(name), m_argument_name(argument_name) {}
71  virtual void set_name( std::string name, std::string argument_name="" ) {
72  m_name = name;
73  if( ! argument_name.empty()) m_argument_name = argument_name;
74  }
79  virtual std::string get_name() const { return m_name.empty() ? "Unknown" : m_name; }
86  virtual void set_argument_name( std::string argument_name ) { m_argument_name = argument_name; }
93  virtual std::string get_argument_name() const { return m_argument_name; }
100  virtual double get_version() const { return 0.0; }
107  virtual std::string get_author() const { return ""; }
114  virtual std::tuple<int,int,int> get_date() const { return std::make_tuple(0,0,0); }
121  virtual std::string get_email_address() const { return ""; }
122  //
123 protected:
128  std::string m_name;
133  std::string m_argument_name;
134 };
135 //
137 //
138 #endif
credit::get_version
virtual double get_version() const
Get version.
Definition: credit.h:100
credit::credit
credit(std::string name, std::string argument_name)
Constructor for credit.
Definition: credit.h:62
credit::get_argument_name
virtual std::string get_argument_name() const
Get an argument name.
Definition: credit.h:93
credit::set_argument_name
virtual void set_argument_name(std::string argument_name)
Set an argument name.
Definition: credit.h:86
credit::credit
credit()=default
Default constructor.
SHKZ_BEGIN_NAMESPACE
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
credit::m_name
std::string m_name
Name of credit.
Definition: credit.h:128
credit::get_email_address
virtual std::string get_email_address() const
Get email address.
Definition: credit.h:121
common.h
credit::get_name
virtual std::string get_name() const
Get the name.
Definition: credit.h:79
credit::set_name
virtual void set_name(std::string name, std::string argument_name="")
Set name (and perhaps, argument name together)
Definition: credit.h:71
credit::get_author
virtual std::string get_author() const
Get author's name.
Definition: credit.h:107
credit::m_argument_name
std::string m_argument_name
Argument name.
Definition: credit.h:133
credit
Class that defines the name, argument name, author's name, email address, date and the version of the...
Definition: credit.h:47
SHKZ_END_NAMESPACE
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
credit::get_date
virtual std::tuple< int, int, int > get_date() const
Get currently set date.
Definition: credit.h:114