globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
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
12
13
14namespace globjects
15{
16
17
18class GLOBJECTS_API CompositeStringSource : public AbstractStringSource, protected ChangeListener
19{
20public:
22 CompositeStringSource(const std::vector<AbstractStringSource *> & sources);
23
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;
32protected:
34
35 virtual void notifyChanged(const Changeable * changeable) override;
36
37 void update() const;
38
39protected:
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
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition AbstractStringSource.h:26
Allows listening to any Changeable.
Definition ChangeListener.h:23
Superclass of all objects that want others to signal that they have changed.
Definition Changeable.h:23
Definition CompositeStringSource.h:19
virtual std::string shortInfo() const override
virtual void flattenInto(std::vector< const AbstractStringSource * > &vector) const override
std::vector< std::string > m_strings
Definition CompositeStringSource.h:43
virtual std::string string() const override
bool m_dirty
Definition CompositeStringSource.h:42
void appendSource(AbstractStringSource *source)
std::vector< ref_ptr< AbstractStringSource > > m_sources
Definition CompositeStringSource.h:40
virtual void notifyChanged(const Changeable *changeable) override
virtual std::vector< std::string > strings() const override
CompositeStringSource(const std::vector< AbstractStringSource * > &sources)
Contains all the classes that wrap OpenGL functionality.