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 
12 
13 
14 namespace globjects
15 {
16 
17 
18 class GLOBJECTS_API CompositeStringSource : public AbstractStringSource, protected ChangeListener
19 {
20 public:
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
std::vector< std::string > m_strings
Definition: CompositeStringSource.h:43
Contains all the classes that wrap OpenGL functionality.
Allows listening to any Changeable.
Definition: ChangeListener.h:22
std::vector< ref_ptr< AbstractStringSource > > m_sources
Definition: CompositeStringSource.h:40
Definition: CompositeStringSource.h:18
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition: AbstractStringSource.h:25
bool m_dirty
Definition: CompositeStringSource.h:42
Superclass of all objects that want others to signal that they have changed.
Definition: Changeable.h:22