Skip to content

Commit

Permalink
Some X const changed to const X
Browse files Browse the repository at this point in the history
  • Loading branch information
yurii-litvinov committed Feb 6, 2015
1 parent b92f5a5 commit b7e90d7
Show file tree
Hide file tree
Showing 1,314 changed files with 11,406 additions and 11,403 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class ROBOTS_GENERATOR_EXPORT ControlFlowGeneratorBase : public QObject, public
/// @param isThisDiagramMain 'true' if this generator generates code for main diagram
/// (main diagram is the one which was active when user requested generation)
ControlFlowGeneratorBase(
qrRepo::RepoApi const &repo
const qrRepo::RepoApi &repo
, qReal::ErrorReporterInterface &errorReporter
, GeneratorCustomizer &customizer
, qReal::Id const &diagramId
, const qReal::Id &diagramId
, QObject *parent = 0
, bool isThisDiagramMain = true);
virtual ~ControlFlowGeneratorBase();
Expand All @@ -32,46 +32,46 @@ class ROBOTS_GENERATOR_EXPORT ControlFlowGeneratorBase : public QObject, public
/// parent. Implementation must pay attention to isThisDiagramMain parameter
/// (it should be always false in copied objects).
/// Ownership on the cloned generators is taken by this generator`s parent.
virtual ControlFlowGeneratorBase *cloneFor(qReal::Id const &diagramId, bool cloneForNewDiagram) = 0;
virtual ControlFlowGeneratorBase *cloneFor(const qReal::Id &diagramId, bool cloneForNewDiagram) = 0;

/// Generates control flow object representation (SemanticTree) and returns
/// a pointer to it if generation process was successfull or NULL otherwise.
/// a pointer to it if generation process was successfull or nullptr otherwise.
/// Takes ownership on result.
/// @param initialNode The starting block of the traversal. If empty then initial node
/// of the diagram given in constructor will be used.
semantics::SemanticTree *generate(qReal::Id const &initialNode = qReal::Id());
semantics::SemanticTree *generate(const qReal::Id &initialNode = qReal::Id());

/// Returns true if some generation errors occured and the generation process can`t be proceeded with other
/// control flow generators (fatal errors occured).
bool errorsOccured() const;

void visitRegular(qReal::Id const &id, QList<LinkInfo> const &links) override;
void visitFinal(qReal::Id const &id, QList<LinkInfo> const &links) override;
void visitFork(qReal::Id const &id, QList<LinkInfo> &links) override;
void visitRegular(const qReal::Id &id, QList<LinkInfo> const &links) override;
void visitFinal(const qReal::Id &id, QList<LinkInfo> const &links) override;
void visitFork(const qReal::Id &id, QList<LinkInfo> &links) override;

protected:
/// Can be overloaded by ancestors for custom behaviour.
virtual void performGeneration();

bool generateForks();

void error(QString const &message, qReal::Id const &id = qReal::Id(), bool critical = true);
void error(const QString &message, const qReal::Id &id = qReal::Id(), bool critical = true);

enums::semantics::Semantics semanticsOf(qReal::Id const &id) const;
enums::semantics::Semantics semanticsOf(const qReal::Id &id) const;
qReal::Id initialNode() const;
QPair<LinkInfo, LinkInfo> ifBranchesFor(qReal::Id const &id) const;
QPair<LinkInfo, LinkInfo> loopBranchesFor(qReal::Id const &id) const;
QPair<LinkInfo, LinkInfo> ifBranchesFor(const qReal::Id &id) const;
QPair<LinkInfo, LinkInfo> loopBranchesFor(const qReal::Id &id) const;

GeneratorCustomizer &customizer() const;

semantics::SemanticTree *mSemanticTree; // Takes ownership
qrRepo::RepoApi const &mRepo;
const qrRepo::RepoApi &mRepo;
qReal::ErrorReporterInterface &mErrorReporter;
GeneratorCustomizer &mCustomizer;
bool mErrorsOccured;
bool const mIsMainGenerator;
const bool mIsMainGenerator;

qReal::Id const mDiagram;
const qReal::Id mDiagram;
PrimaryControlFlowValidator *mValidator; // Takes owneship via Qt parentship system
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class ROBOTS_GENERATOR_EXPORT DynamicPathConverter : public TemplateParametrized
public:
/// @param pathFromRoot A path from templates root containing placeholder for data
/// (for example colors/@@PATH@@.t)
DynamicPathConverter(QString const &pathToTemplates, QString const &pathFromRoot);
DynamicPathConverter(const QString &pathToTemplates, const QString &pathFromRoot);

QString convert(QString const &data) const override;
QString convert(const QString &data) const override;

private:
QString const mPathFromRoot;
const QString mPathFromRoot;
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ namespace converters {
class ROBOTS_GENERATOR_EXPORT EnumConverterBase : public TemplateParametrizedConverter
{
public:
EnumConverterBase(QString const &pathToTemplatesDir
EnumConverterBase(const QString &pathToTemplatesDir
, QMap<QString, QString> const &valuesToTemplatePaths = QMap<QString, QString>());

QString convert(QString const &data) const override;
QString convert(const QString &data) const override;

protected:
void addMapping(QString const &enumValue, QString const &templatePath);
void addMapping(const QString &enumValue, const QString &templatePath);

private:
QMap<QString, QString> mValuesToTemplates;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ namespace converters {
class ROBOTS_GENERATOR_EXPORT RegexpMultiConverter : public simple::Binding::MultiConverterInterface
{
public:
RegexpMultiConverter(QString const &splitRegexp, simple::Binding::ConverterInterface const * const converter);
RegexpMultiConverter(const QString &splitRegexp, const simple::Binding::ConverterInterface * const converter);
~RegexpMultiConverter() override;

QStringList convert(QString const &data) const override;
QStringList convert(const QString &data) const override;

private:
QString const mSplitRegexp;
simple::Binding::ConverterInterface const * const mSimpleConverter;
const QString mSplitRegexp;
const simple::Binding::ConverterInterface * const mSimpleConverter;
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ROBOTS_GENERATOR_EXPORT TemplateParametrizedConverter : public simple::Bin
, public TemplateParametrizedEntity
{
public:
explicit TemplateParametrizedConverter(QString const &pathToTemplates);
explicit TemplateParametrizedConverter(const QString &pathToTemplates);
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ROBOTS_GENERATOR_EXPORT TemplateParametrizedMultiConverter : public simple
, public TemplateParametrizedEntity
{
public:
explicit TemplateParametrizedMultiConverter(QString const &pathToTemplates);
explicit TemplateParametrizedMultiConverter(const QString &pathToTemplates);
virtual ~TemplateParametrizedMultiConverter();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ class ROBOTS_GENERATOR_EXPORT GeneratorCustomizer
{
public:
/// Implementation must tell if block with given id has initial node semantics
virtual bool isInitialNode(qReal::Id const &block) const;
virtual bool isInitialNode(const qReal::Id &block) const;

/// Implementation must tell if block with given id has final node semantics
virtual bool isFinalNode(qReal::Id const &block) const;
virtual bool isFinalNode(const qReal::Id &block) const;

/// Implementation must tell if block with given id calls some new routine
virtual bool isSubprogramCall(qReal::Id const &block) const;
virtual bool isSubprogramCall(const qReal::Id &block) const;

/// Returns semantics type of the given block
enums::semantics::Semantics semanticsOf(qReal::Id const &block) const;
enums::semantics::Semantics semanticsOf(const qReal::Id &block) const;

/// Initializes everything that couldn`t be initialized in constructor
/// (for example, everything about pure virtual methods)
Expand All @@ -51,25 +51,25 @@ class ROBOTS_GENERATOR_EXPORT GeneratorCustomizer
GeneratorCustomizer();

/// Implementation must tell if block with given id has if-block semantics
virtual bool isConditional(qReal::Id const &block) const;
virtual bool isConditional(const qReal::Id &block) const;

/// Implementation must tell if block with given id has loop semantics
virtual bool isLoop(qReal::Id const &block) const;
virtual bool isLoop(const qReal::Id &block) const;

/// Implementation must tell if block with given id has switch semantics
virtual bool isSwitch(qReal::Id const &block) const;
virtual bool isSwitch(const qReal::Id &block) const;

/// Implementation must tell if block with given id has fork semantics
virtual bool isFork(qReal::Id const &block) const;
virtual bool isFork(const qReal::Id &block) const;

private:
qReal::Id const mDefaultInitialBlockType;
qReal::Id const mDefaultFinalBlockType;
qReal::Id const mDefaultConditionalBlockType;
qReal::Id const mDefaultLoopBlockType;
qReal::Id const mDefaultSwitchBlockType;
qReal::Id const mDefaultForkBlockType;
qReal::Id const mDefaultSubprogramCallBlockType;
const qReal::Id mDefaultInitialBlockType;
const qReal::Id mDefaultFinalBlockType;
const qReal::Id mDefaultConditionalBlockType;
const qReal::Id mDefaultLoopBlockType;
const qReal::Id mDefaultSwitchBlockType;
const qReal::Id mDefaultForkBlockType;
const qReal::Id mDefaultSubprogramCallBlockType;
};

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ class GeneratorCustomizer;
class ROBOTS_GENERATOR_EXPORT GeneratorFactoryBase : public QObject
{
public:
GeneratorFactoryBase(qrRepo::RepoApi const &repo
GeneratorFactoryBase(const qrRepo::RepoApi &repo
, qReal::ErrorReporterInterface &errorReporter
, interpreterBase::robotModel::RobotModelManagerInterface const &robotModelManager
, const interpreterBase::robotModel::RobotModelManagerInterface &robotModelManager
, lua::LuaProcessor &luaProcessor);

virtual ~GeneratorFactoryBase();

void initialize();

/// Sets an id of the root diagram for obtaining sensors configuration.
void setMainDiagramId(qReal::Id const &diagramId);
void setMainDiagramId(const qReal::Id &diagramId);

// ------------------------------- Parts -----------------------------------

Expand Down Expand Up @@ -77,63 +77,63 @@ class ROBOTS_GENERATOR_EXPORT GeneratorFactoryBase : public QObject
// ----------------------------- Generators --------------------------------

/// Returns a pointer to a code generator for blocks with if semantics
virtual simple::AbstractSimpleGenerator *ifGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *ifGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer
, bool elseIsEmpty
, bool needInverting);

/// Returns a pointer to a code generator for infinite loops
virtual simple::AbstractSimpleGenerator *infiniteLoopGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *infiniteLoopGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a code generator for 'while-do' and 'do-while' loops
virtual simple::AbstractSimpleGenerator *whileLoopGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *whileLoopGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer
, bool doWhileForm
, bool needInverting);

/// Returns a pointer to a code generator for loops in 'for' form
virtual simple::AbstractSimpleGenerator *forLoopGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *forLoopGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a code generator for switch first enumeration block.
virtual simple::AbstractSimpleGenerator *switchHeadGenerator(qReal::Id const &id
, GeneratorCustomizer &customizer, QStringList const &values);
virtual simple::AbstractSimpleGenerator *switchHeadGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer, const QStringList &values);

/// Returns a pointer to a code generator for switch enumeration block somewhere in the middle.
virtual simple::AbstractSimpleGenerator *switchMiddleGenerator(qReal::Id const &id
, GeneratorCustomizer &customizer, QStringList const &values);
virtual simple::AbstractSimpleGenerator *switchMiddleGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer, const QStringList &values);

/// Returns a pointer to a code generator for switch enumeration block in the end (default case).
virtual simple::AbstractSimpleGenerator *switchDefaultGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *switchDefaultGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a threads instantiation generator
virtual simple::AbstractSimpleGenerator *forkCallGenerator(qReal::Id const &id
, GeneratorCustomizer &customizer, qReal::IdList const &threads);
virtual simple::AbstractSimpleGenerator *forkCallGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer, const qReal::IdList &threads);

/// Returns a pointer to a code generator for blocks with regular semantics
virtual simple::AbstractSimpleGenerator *simpleGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *simpleGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a code generator for 'break' instruction
virtual simple::AbstractSimpleGenerator *breakGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *breakGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a code generator for 'continue' instruction
virtual simple::AbstractSimpleGenerator *continueGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *continueGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a code generator for goto label declaration
virtual simple::AbstractSimpleGenerator *labelGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *labelGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a code generator for 'goto' instruction
virtual simple::AbstractSimpleGenerator *gotoSimpleGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *gotoSimpleGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer);

/// Returns a pointer to a code generator for blocks with final-blocks semantics
virtual simple::AbstractSimpleGenerator *finalNodeGenerator(qReal::Id const &id
virtual simple::AbstractSimpleGenerator *finalNodeGenerator(const qReal::Id &id
, GeneratorCustomizer &customizer, bool fromMainGenerator);

/// Implementation must return a path to a folder containing templates for
Expand All @@ -144,23 +144,23 @@ class ROBOTS_GENERATOR_EXPORT GeneratorFactoryBase : public QObject

/// Produces converter for expressions which should have int type
/// without taking ownership on it
virtual simple::Binding::ConverterInterface *intPropertyConverter(qReal::Id const &block
, QString const &property) const;
virtual simple::Binding::ConverterInterface *intPropertyConverter(const qReal::Id &block
, const QString &property) const;

/// Produces converter for expressions which should have float type
/// without taking ownership on it
virtual simple::Binding::ConverterInterface *floatPropertyConverter(qReal::Id const &block
, QString const &property) const;
virtual simple::Binding::ConverterInterface *floatPropertyConverter(const qReal::Id &block
, const QString &property) const;

/// Produces converter for expressions which should have bool type
/// without taking ownership on it
virtual simple::Binding::ConverterInterface *boolPropertyConverter(qReal::Id const &block
, QString const &property, bool needInverting) const;
virtual simple::Binding::ConverterInterface *boolPropertyConverter(const qReal::Id &block
, const QString &property, bool needInverting) const;

/// Produces converter for expressions which should have string type
/// without taking ownership on it
virtual simple::Binding::ConverterInterface *stringPropertyConverter(qReal::Id const &block
, QString const &property) const;
virtual simple::Binding::ConverterInterface *stringPropertyConverter(const qReal::Id &block
, const QString &property) const;

/// Produces a converter that returns an expression that obtain values of system variables
/// getting its name or the given string othrewise. Transfers ownership.
Expand All @@ -172,8 +172,8 @@ class ROBOTS_GENERATOR_EXPORT GeneratorFactoryBase : public QObject

/// Produces converter for transformation function block code into
/// generator-dependent code without taking ownership on it
virtual simple::Binding::ConverterInterface *functionBlockConverter(qReal::Id const &block
, QString const &property) const;
virtual simple::Binding::ConverterInterface *functionBlockConverter(const qReal::Id &block
, const QString &property) const;

/// Produces converter for transformation repo property of the type 'Sign' to
/// generator-dependent infix inequality sign without taking ownership on it
Expand All @@ -194,7 +194,7 @@ class ROBOTS_GENERATOR_EXPORT GeneratorFactoryBase : public QObject

/// Returns a pointer to a converter that makes one composite switch enumeration block from a set
/// of their values. Accepts an expression that will be compared to @arg values.
virtual simple::Binding::ConverterInterface *switchConditionsMerger(QStringList const &values) const;
virtual simple::Binding::ConverterInterface *switchConditionsMerger(const QStringList &values) const;

// ------------------------- Init-terminate code ---------------------------

Expand Down Expand Up @@ -238,9 +238,9 @@ class ROBOTS_GENERATOR_EXPORT GeneratorFactoryBase : public QObject
/// Returns sensors configuration for the given robot model.
QMap<interpreterBase::robotModel::PortInfo, interpreterBase::robotModel::DeviceInfo> currentConfiguration() const;

qrRepo::RepoApi const &mRepo;
const qrRepo::RepoApi &mRepo;
qReal::ErrorReporterInterface &mErrorReporter;
interpreterBase::robotModel::RobotModelManagerInterface const &mRobotModelManager;
const interpreterBase::robotModel::RobotModelManagerInterface &mRobotModelManager;
lua::LuaProcessor &mLuaTranslator;
qReal::Id mDiagram;
parts::Variables *mVariables;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class GeneratorKitPluginInterface

/// Shall be overriden in concrete plugin to initialize itself.
/// @param configurator Object that contains all needed information for a plugin, like refs to models.
virtual void init(qReal::PluginConfigurator const &configurator
, interpreterBase::robotModel::RobotModelManagerInterface const &robotModelManager
virtual void init(const qReal::PluginConfigurator &configurator
, const interpreterBase::robotModel::RobotModelManagerInterface &robotModelManager
, qrtext::LanguageToolboxInterface &textLanguage)
{
Q_UNUSED(configurator);
Expand Down
Loading

0 comments on commit b7e90d7

Please sign in to comment.