Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6092: Add infrastructure to handle FX declarations.
- Loading branch information
1 parent
08b6798
commit 61179c9
Showing
11 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include "ideclmanager.h" | ||
|
||
namespace fx | ||
{ | ||
|
||
class IFxDeclaration : | ||
public decl::IDeclaration | ||
{ | ||
public: | ||
|
||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "FxDeclaration.h" | ||
|
||
namespace fx | ||
{ | ||
|
||
FxDeclaration::FxDeclaration(const std::string& name) : | ||
DeclarationBase<IFxDeclaration>(decl::Type::Fx, name) | ||
{} | ||
|
||
void FxDeclaration::parseFromTokens(parser::DefTokeniser& tokeniser) | ||
{ | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "ifx.h" | ||
#include "decl/DeclarationBase.h" | ||
|
||
namespace fx | ||
{ | ||
|
||
class FxDeclaration : | ||
public decl::DeclarationBase<IFxDeclaration> | ||
{ | ||
public: | ||
FxDeclaration(const std::string& name); | ||
|
||
protected: | ||
void parseFromTokens(parser::DefTokeniser& tokeniser) override; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "FxManager.h" | ||
|
||
#include "decl/DeclarationCreator.h" | ||
#include "module/StaticModule.h" | ||
#include "FxDeclaration.h" | ||
|
||
namespace fx | ||
{ | ||
|
||
const std::string& FxManager::getName() const | ||
{ | ||
static std::string _name("FxManager"); | ||
return _name; | ||
} | ||
|
||
const StringSet& FxManager::getDependencies() const | ||
{ | ||
static StringSet _dependencies | ||
{ | ||
MODULE_DECLMANAGER, | ||
}; | ||
|
||
return _dependencies; | ||
} | ||
|
||
void FxManager::initialiseModule(const IApplicationContext& ctx) | ||
{ | ||
GlobalDeclarationManager().registerDeclType("fx", std::make_shared<decl::DeclarationCreator<FxDeclaration>>(decl::Type::Fx)); | ||
GlobalDeclarationManager().registerDeclFolder(decl::Type::Fx, "fx/", ".fx"); | ||
} | ||
|
||
// Static module instance | ||
module::StaticModuleRegistration<FxManager> fxManagerModule; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include "imodule.h" | ||
|
||
namespace fx | ||
{ | ||
|
||
class FxManager final : | ||
public RegisterableModule | ||
{ | ||
public: | ||
// RegisterableModule implementation | ||
const std::string& getName() const override; | ||
const StringSet& getDependencies() const override; | ||
void initialiseModule(const IApplicationContext& ctx) override; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters