| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

CompositeStringSource.h
Go to the documentation of this file.
1
2 #pragma once
3
4 #include <string>
5 #include <vector>
6
7 #include <globjects/globjects_api.h>
8
9 #include <globjects/base/ref_ptr.h>
10 #include <globjects/base/ChangeListener.h>
11 #include <globjects/base/AbstractStringSource.h>
12
13
14 namespace globjects
15 {
16
17
18 class GLOBJECTS_API CompositeStringSource : public AbstractStringSource, protected ChangeListener
19 {
20 public:
21 CompositeStringSource();
22 CompositeStringSource(const std::vector<AbstractStringSource *> & sources);
23
24 void appendSource(AbstractStringSource * source);
25
26 virtual std::string string() const override;
27 virtual std::vector<std::string> strings() const override;
28
29 virtual void flattenInto(std::vector<const AbstractStringSource *> & vector) const override;
30
31 virtual std::string shortInfo() const override;
32 protected:
33 virtual ~CompositeStringSource();
34
35 virtual void notifyChanged(const Changeable * changeable) override;
36
37 void update() const;
38
39 protected:
40 std::vector<ref_ptr<AbstractStringSource>> m_sources;
41
42 mutable bool m_dirty;
43 mutable std::vector<std::string> m_strings;
44 };
45
46
47 } // namespace globjects
globjects::CompositeStringSource::m_dirty
bool m_dirty
Definition: CompositeStringSource.h:42
ChangeListener.h
globjects
Contains all the classes that wrap OpenGL functionality.
ref_ptr.h
globjects::CompositeStringSource
Definition: CompositeStringSource.h:18
globjects::Changeable
Superclass of all objects that want others to signal that they have changed.
Definition: Changeable.h:22
globjects::CompositeStringSource::m_sources
std::vector< ref_ptr< AbstractStringSource > > m_sources
Definition: CompositeStringSource.h:40
AbstractStringSource.h
globjects::ChangeListener
Allows listening to any Changeable.
Definition: ChangeListener.h:22
globjects::CompositeStringSource::m_strings
std::vector< std::string > m_strings
Definition: CompositeStringSource.h:43
globjects::AbstractStringSource
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code...
Definition: AbstractStringSource.h:25