This file is indexed.

/usr/include/JAGS/module/Module.h is in jags 4.2.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef _MODULE_H_
#define _MODULE_H_

#include <vector>
#include <string>
#include <list>
#include <utility>

#include <function/FunctionPtr.h>
#include <distribution/DistPtr.h>

namespace jags {

class SamplerFactory;
class RNGFactory;
class MonitorFactory;
class LinkFunctiontion;
class ScalarFunction;
class VectorFunction;
class ArrayFunction;
class ScalarDist;
class RScalarDist;
class VectorDist;
class ArrayDist;

/**
 * @short Memory management for dynamically loadable modules
 *
 * Dynamically loadable modules may extend the capabilities of the JAGS library
 * by defining new subclasses of Function, Distribution, SamplerFactory, 
 * and RNGFactory. 
 *
 * Each module must instantiate a subclass of Module. The constructor for
 * this subcluass must dynamically allocate instances of the sub-classes 
 * defined by the module, and store them with the appropriate insert 
 * member function.
 */
class Module {
    std::string _name;
    bool _loaded;
    std::vector<FunctionPtr> _fp_list;
    std::vector<Function*> _functions;
    std::vector<std::pair<DistPtr, FunctionPtr> > _obs_functions;
    std::vector<DistPtr> _dp_list;
    std::vector<Distribution*> _distributions;
    std::vector<SamplerFactory*> _sampler_factories;
    std::vector<RNGFactory*> _rng_factories;
    std::vector<MonitorFactory*> _monitor_factories;
public:
    Module(std::string const &name);
    virtual ~Module();

    void insert(ScalarFunction*);
    void insert(LinkFunction*);
    void insert(VectorFunction*);
    void insert(ArrayFunction*);
    void insert(Distribution*);

    void insert(RScalarDist*);
    void insert(ScalarDist*);
    void insert(VectorDist*);
    void insert(ArrayDist*);

    void insert(ScalarDist*, ScalarFunction*);
    void insert(ScalarDist*, LinkFunction*);
    void insert(ScalarDist*, VectorFunction*);
    void insert(ScalarDist*, ArrayFunction*);

    void insert(VectorDist*, ScalarFunction*);
    void insert(VectorDist*, LinkFunction*);
    void insert(VectorDist*, VectorFunction*);
    void insert(VectorDist*, ArrayFunction*);

    void insert(ArrayDist*, ScalarFunction*);
    void insert(ArrayDist*, LinkFunction*);
    void insert(ArrayDist*, VectorFunction*);
    void insert(ArrayDist*, ArrayFunction*);

    void insert(SamplerFactory*);
    void insert(RNGFactory*);
    void insert(MonitorFactory*);

    std::vector<Function*> const &functions() const;
    std::vector<Distribution*> const &distributions() const;
    std::vector<SamplerFactory*> const &samplerFactories() const;
    std::vector<RNGFactory*> const &rngFactories() const;
    std::vector<MonitorFactory*> const &monitorFactories() const;
    
    void load();
    void unload();
    std::string const &name() const;
    static std::list<Module *> &modules();
    static std::list<Module *> &loadedModules();
};

} /* namespace jags */

#endif /* _MODULE_H_ */