RMF
Toggle main menu visibility
Decorator.h
Go to the documentation of this file.
1
/**
2
* \file RMF/Decorator.h
3
* \brief Mostly empty base classes for decorators and factories.
4
*
5
* Copyright 2007-2022 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef RMF_DECORATOR_H
10
#define RMF_DECORATOR_H
11
12
#include "RMF/config.h"
13
#include "
infrastructure_macros.h
"
14
#include "
ID.h
"
15
#include "internal/SharedData.h"
16
#include "
NodeConstHandle.h
"
17
#include "
NodeHandle.h
"
18
#include <memory>
19
20
RMF_ENABLE_WARNINGS
21
namespace
RMF
{
22
23
//! The base class for decorators.
24
/** Decorators in RMF provide high level routines to manipulate attributes
25
of nodes in the hierarchy. They are created by an associated Factory.
26
27
See [Decorators and attributes](\ref decoratorsattributes) for more info.
28
*/
29
class
Decorator {
30
private
:
31
NodeID
id_;
32
std::shared_ptr<internal::SharedData> data_;
33
34
protected
:
35
Decorator(
NodeConstHandle
handle)
36
: id_(handle.
get_id
()), data_(handle.get_shared_data()) {};
37
38
NodeHandle
get_node()
const
{
return
NodeHandle
(id_, data_); }
39
40
public
:
41
RMF_SHOWABLE(Decorator, get_node().get_name());
42
};
43
//! The base class for Factories
44
/** This common base class for all factories is here for organizational
45
* purposes. It doesn't provide any functionality. */
46
class
Factory
{};
47
48
}
/* namespace RMF */
49
50
RMF_DISABLE_WARNINGS
51
52
#endif
/* RMF_DECORATOR_H */
ID.h
Declaration of RMF::ID.
NodeConstHandle.h
Declaration of NodeConstHandle.
NodeHandle.h
Declaration of NodeHandle.
RMF::Factory
The base class for Factories.
Definition
Decorator.h:46
RMF::NodeConstHandle
A handle for a particular node in a read-only hierarchy.
Definition
NodeConstHandle.h:86
RMF::NodeConstHandle::get_id
NodeID get_id() const
Definition
NodeConstHandle.h:135
RMF::NodeHandle
A handle for a particular node in the hierarchy.
Definition
NodeHandle.h:60
infrastructure_macros.h
Various general useful macros for IMP.
RMF
The namespace for all functionality in the library.
Definition
BufferConstHandle.h:21
RMF::NodeID
ID< NodeTag > NodeID
Definition
ID.h:106