GMLC-TDC / HELICS

@@ -23,16 +23,19 @@
Loading
23 23
24 24
namespace BrokerFactory {
25 25
26 -
    using BuildT = std::tuple<int, std::string, std::shared_ptr<BrokerBuilder>>;
27 -
26 +
    /*** class to holder the set of builders
27 +
    @details this doesn't work as a global since it tends to get initialized after some of the things that call it
28 +
    so it needs to be a static member of function call*/
28 29
    class MasterBrokerBuilder
29 30
    {
30 31
    public:
32 +
        using BuildT = std::tuple<int, std::string, std::shared_ptr<BrokerBuilder>>;
33 +
31 34
        static void addBuilder(std::shared_ptr<BrokerBuilder> cb, const std::string& name, int code)
32 35
        {
33 36
            instance()->builders.emplace_back(code, name, std::move(cb));
34 37
        }
35 -
        static std::shared_ptr<BrokerBuilder> &getBuilder(int code)
38 +
        static const std::shared_ptr<BrokerBuilder> &getBuilder(int code)
36 39
        {
37 40
            for (auto &bb : instance()->builders)
38 41
            {
@@ -43,7 +46,7 @@
Loading
43 46
            }
44 47
            throw(HelicsException("core type is not available"));
45 48
        }
46 -
        static std::shared_ptr<BrokerBuilder> &getIndexedBuilder(std::size_t index)
49 +
        static const std::shared_ptr<BrokerBuilder> &getIndexedBuilder(std::size_t index)
47 50
        {
48 51
            auto &blder = instance();
49 52
            if (blder->builders.size() <= index)
@@ -52,14 +55,16 @@
Loading
52 55
            }
53 56
            return std::get<2>(blder->builders[index]);
54 57
        }
55 -
        static std::shared_ptr<MasterBrokerBuilder> &instance()
58 +
        static const std::shared_ptr<MasterBrokerBuilder> &instance()
56 59
        {
57 60
            static std::shared_ptr<MasterBrokerBuilder> iptr(new MasterBrokerBuilder());
58 61
            return iptr;
59 62
        }
60 63
    private:
64 +
        /** private constructor since we only really want one of them
65 +
        accessed through the instance static member*/
61 66
        MasterBrokerBuilder() = default;
62 -
        std::vector<BuildT> builders;
67 +
        std::vector<BuildT> builders; //!< container for the builders
63 68
    };
64 69
    
65 70
    void defineBrokerBuilder(std::shared_ptr<BrokerBuilder> cb, const std::string& name, int code)

@@ -50,7 +50,7 @@
Loading
50 50
        }
51 51
    };
52 52
53 -
    /** defineCoreBuilder */
53 +
    /** define a new Broker Builder from the builder give a name and build code*/
54 54
    void defineBrokerBuilder(std::shared_ptr<BrokerBuilder> cb, const std::string &name, int code);
55 55
56 56
    /** template function to create a builder and link it into the library*/

@@ -52,7 +52,7 @@
Loading
52 52
        }
53 53
    };
54 54
   
55 -
    /** defineCoreBuilder */
55 +
    //** define a new Core Builder from the builder give a name and build code*/
56 56
    void defineCoreBuilder(std::shared_ptr<CoreBuilder> cb, const std::string& coreTypeName, int code);
57 57
58 58
    /** template function to create a builder and link it into the library*/

@@ -27,16 +27,20 @@
Loading
27 27
namespace CoreFactory {
28 28
    static const std::string emptyString;
29 29
30 -
    using BuildT = std::tuple<int, std::string, std::shared_ptr<CoreBuilder>>;
31 -
30 +
    
31 +
    /*** class to holder the set of builders
32 +
   @details this doesn't work as a global since it tends to get initialized after some of the things that call it
33 +
   so it needs to be a static member of function call*/
32 34
    class MasterCoreBuilder
33 35
    {
34 36
    public:
37 +
        using BuildT = std::tuple<int, std::string, std::shared_ptr<CoreBuilder>>;
38 +
35 39
        static void addBuilder(std::shared_ptr<CoreBuilder> cb, const std::string& name, int code)
36 40
        {
37 41
            instance()->builders.emplace_back(code, name, std::move(cb));
38 42
        }
39 -
        static std::shared_ptr<CoreBuilder> &getBuilder(int code)
43 +
        static const std::shared_ptr<CoreBuilder> &getBuilder(int code)
40 44
        {
41 45
            for (auto &bb : instance()->builders)
42 46
            {
@@ -47,7 +51,7 @@
Loading
47 51
            }
48 52
            throw(HelicsException("core type is not available"));
49 53
        }
50 -
        static std::shared_ptr<CoreBuilder> &getIndexedBuilder(std::size_t index)
54 +
        static const std::shared_ptr<CoreBuilder> &getIndexedBuilder(std::size_t index)
51 55
        {
52 56
            auto &blder = instance();
53 57
            if (blder->builders.size() <= index)
@@ -56,14 +60,16 @@
Loading
56 60
            }
57 61
            return std::get<2>(blder->builders[index]);
58 62
        }
59 -
        static std::shared_ptr<MasterCoreBuilder> &instance()
63 +
        static const std::shared_ptr<MasterCoreBuilder> &instance()
60 64
        {
61 65
            static std::shared_ptr<MasterCoreBuilder> iptr(new MasterCoreBuilder());
62 66
            return iptr;
63 67
        }
64 68
    private:
69 +
        /** private constructor since we only really want one of them
70 +
        accessed through the instance static member*/
65 71
        MasterCoreBuilder() = default;
66 -
        std::vector<BuildT> builders;
72 +
        std::vector<BuildT> builders; //!< container for the different builders
67 73
    };
68 74
69 75
    void defineCoreBuilder(std::shared_ptr<CoreBuilder> cb, const std::string& name, int code)
Files Coverage
src/helics 74.44%
Project Totals (204 files) 74.44%
9439.5
TRAVIS_OS_NAME=linux
9438.4
TRAVIS_OS_NAME=linux
1
codecov:
2
  notify:
3
    require_ci_to_pass: no
4
  branch: develop
5

6
coverage:
7
  precision: 2
8
  round: down
9
  range: "50...95"
10
  status:
11
    project: yes
12
    patch: yes
13
    changes: no
14

15
parsers:
16
  gcov:
17
    branch_detection:
18
      conditional: yes
19
      loop: yes
20
      method: no
21
      macro: no
22

23
comment:
24
  layout: "header, diff"
25
  behavior: default
26
  require_changes: no
27

28
ignore:
29
  - "ThirdParty"
30
  - "examples"
31
  - "tests"
32
  - "interfaces"
33
  - "src/helics/core/mpi"
34
  - "**/logger.*"
35
  - "**/loggerCore.*"
36
  - "**/zmqHelper.*"
37
  - "src/helics/shared_api_library/internal/api_objects.h"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading