Debian Codegraph @

doc/example-plugin/src/atlas-example-plugin/Library.cc

raw
1 /*
2 * (C) Copyright 2023- ECMWF.
3 *
4 * This software is licensed under the terms of the Apache Licence Version 2.0
5 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #include <string>
12
13 #include "atlas-example-plugin/Library.h"
14 #include "atlas-example-plugin/version.h"
15
16
17 namespace atlas {
18 namespace example_plugin {
19
20
21 REGISTER_LIBRARY( Library );
22
23
24 Library::Library() : Plugin( "atlas-example-plugin" ) {}
25
26
27 const Library& Library::instance() {
28 static Library library;
29 return library;
30 }
31
32
33 std::string Library::version() const {
34 return atlas_example_plugin_version();
35 }
36
37
38 std::string Library::gitsha1( unsigned int count ) const {
39 std::string sha1 = atlas_example_plugin_git_sha1();
40 return sha1.empty() ? "not available" : sha1.substr( 0, std::min( count, 40U ) );
41 }
42
43
44 void Library::init() {
45 Plugin::init();
46 }
47
48
49 } // namespace example_plugin
50 } // namespace atlas