Loading...
Searching...
No Matches
CompositeStringSource.h
Go to the documentation of this file.
#pragma once
#include <string>
#include <vector>
#include <globjects/globjects_api.h>
#include <globjects/base/ref_ptr.h>
#include <globjects/base/ChangeListener.h>
#include <globjects/base/AbstractStringSource.h>
namespace globjects
{
class GLOBJECTS_API CompositeStringSource : public AbstractStringSource, protected ChangeListener
{
public:
CompositeStringSource();
CompositeStringSource(const std::vector<AbstractStringSource *> & sources);
void appendSource(AbstractStringSource * source);
virtual std::string string() const override;
virtual std::vector<std::string> strings() const override;
virtual void flattenInto(std::vector<const AbstractStringSource *> & vector) const override;
virtual std::string shortInfo() const override;
protected:
virtual ~CompositeStringSource();
virtual void notifyChanged(const Changeable * changeable) override;
void update() const;
protected:
std::vector<ref_ptr<AbstractStringSource>> m_sources;
mutable bool m_dirty;
mutable std::vector<std::string> m_strings;
};
} // namespace globjects
AbstractStringSource.h
ChangeListener.h
globjects::AbstractStringSource
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition AbstractStringSource.h:26
globjects::ChangeListener
Allows listening to any Changeable.
Definition ChangeListener.h:23
globjects::Changeable
Superclass of all objects that want others to signal that they have changed.
Definition Changeable.h:23
globjects::CompositeStringSource
Definition CompositeStringSource.h:19
globjects::CompositeStringSource::shortInfo
virtual std::string shortInfo() const override
globjects::CompositeStringSource::flattenInto
virtual void flattenInto(std::vector< const AbstractStringSource * > &vector) const override
globjects::CompositeStringSource::m_strings
std::vector< std::string > m_strings
Definition CompositeStringSource.h:43
globjects::CompositeStringSource::string
virtual std::string string() const override
globjects::CompositeStringSource::m_dirty
bool m_dirty
Definition CompositeStringSource.h:42
globjects::CompositeStringSource::appendSource
void appendSource(AbstractStringSource *source)
globjects::CompositeStringSource::update
void update() const
globjects::CompositeStringSource::m_sources
std::vector< ref_ptr< AbstractStringSource > > m_sources
Definition CompositeStringSource.h:40
globjects::CompositeStringSource::~CompositeStringSource
virtual ~CompositeStringSource()
globjects::CompositeStringSource::CompositeStringSource
CompositeStringSource()
globjects::CompositeStringSource::notifyChanged
virtual void notifyChanged(const Changeable *changeable) override
globjects::CompositeStringSource::strings
virtual std::vector< std::string > strings() const override
globjects::CompositeStringSource::CompositeStringSource
CompositeStringSource(const std::vector< AbstractStringSource * > &sources)
globjects
Contains all the classes that wrap OpenGL functionality.
ref_ptr.h