SHOGUN  6.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Version.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #include <shogun/base/Version.h>
12 #include <shogun/lib/versionstring.h>
13 #include <shogun/lib/config.h>
14 #include <shogun/lib/memory.h>
15 #include <shogun/io/SGIO.h>
16 #include <shogun/lib/RefCount.h>
17 
18 using namespace shogun;
19 
20 namespace shogun
21 {
22 const int32_t Version::version_revision = VERSION_REVISION;
23 const int32_t Version::version_year = VERSION_YEAR;
24 const int32_t Version::version_month = VERSION_MONTH;
25 const int32_t Version::version_day = VERSION_DAY;
26 const int32_t Version::version_hour = VERSION_HOUR;
27 const int32_t Version::version_minute = VERSION_MINUTE;
28 const int32_t Version::version_parameter=VERSION_PARAMETER;
29 const char Version::version_extra[128] = VERSION_EXTRA;
30 const char Version::version_release[128] = VERSION_RELEASE;
31 }
32 
34 {
35  m_refcount = new RefCount();
36 }
37 
38 
40 {
41  delete m_refcount;
42 }
43 
45 {
46  SG_SPRINT("libshogun (%s/%s%d)\n\n", MACHINE, VERSION_RELEASE, version_revision)
47  SG_SPRINT("Copyright (C) 1999-2009 Fraunhofer Institute FIRST\n")
48  SG_SPRINT("Copyright (C) 1999-2011 Max Planck Society\n")
49  SG_SPRINT("Copyright (C) 2009-2011 Berlin Institute of Technology\n")
50  SG_SPRINT("Copyright (C) 2012-2014 Soeren Sonnenburg, Sergey Lisitsyn, Heiko Strathmann, Viktor Gal, Fernando Iglesias et al\n")
51  SG_SPRINT("Written (W) 1999-2012 Soeren Sonnenburg, Gunnar Raetsch et al.\n\n")
52 #ifndef USE_SVMLIGHT
53  SG_SPRINT("This is free software; see the source for copying conditions. There is NO\n")
54  SG_SPRINT("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n")
55 #endif
56 }
57 
59 {
60  return version_extra;
61 }
62 
64 {
65  return version_release;
66 }
67 
69 {
70  return version_revision;
71 }
72 
74 {
75  return version_year;
76 }
77 
79 {
80  return version_month;
81 }
82 
84 {
85  return version_day;
86 }
87 
89 {
90  return version_hour;
91 }
92 
94 {
95  return version_year;
96 }
97 
99 {
100  return version_parameter;
101 }
102 
104 {
105  return ((((version_year)*12 + version_month)*30 + version_day)* 24 + version_hour)*60 + version_minute;
106 }
107 
108 int32_t Version::ref()
109 {
110  return m_refcount->ref();
111 }
112 
113 int32_t Version::ref_count() const
114 {
115  return m_refcount->ref_count();
116 }
117 
118 int32_t Version::unref()
119 {
120  int32_t rc = m_refcount->unref();
121 
122  if (rc==0)
123  {
124  delete this;
125  return 0;
126  }
127 
128  return rc;
129 }
#define MACHINE
Definition: config.h:4
int32_t unref()
Definition: Version.cpp:118
static const char * get_version_release()
Definition: Version.cpp:63
virtual ~Version()
Definition: Version.cpp:39
static const char * get_version_extra()
Definition: Version.cpp:58
static int32_t get_version_hour()
Definition: Version.cpp:88
int32_t ref_count() const
Definition: Version.cpp:113
static int32_t get_version_year()
Definition: Version.cpp:73
static int32_t get_version_month()
Definition: Version.cpp:78
static int32_t get_version_parameter()
Definition: Version.cpp:98
SG_FORCED_INLINE int32_t ref()
Definition: RefCount.h:26
static const char version_release[128]
Definition: Version.h:86
static const char version_extra[128]
Definition: Version.h:88
static int32_t get_version_day()
Definition: Version.cpp:83
#define SG_SPRINT(...)
Definition: SGIO.h:179
static const int32_t version_revision
Definition: Version.h:91
SG_FORCED_INLINE int32_t unref()
Definition: RefCount.h:35
static const int32_t version_day
Definition: Version.h:97
static const int32_t version_year
Definition: Version.h:93
static const int32_t version_hour
Definition: Version.h:99
static const int32_t version_parameter
Definition: Version.h:103
static const int32_t version_month
Definition: Version.h:95
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
static int64_t get_version_in_minutes()
Definition: Version.cpp:103
SG_FORCED_INLINE int32_t ref_count()
Definition: RefCount.h:44
static int32_t get_version_revision()
Definition: Version.cpp:68
static int32_t get_version_minute()
Definition: Version.cpp:93
int32_t ref()
Definition: Version.cpp:108
static const int32_t version_minute
Definition: Version.h:101
static void print_version()
Definition: Version.cpp:44

SHOGUN Machine Learning Toolbox - Documentation