-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CPPSDK: aggregate files based on suffix type handling added, module a…
…nd override module generation also handled
- Loading branch information
1 parent
b7a27f0
commit 4b9f825
Showing
34 changed files
with
508 additions
and
199 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
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
2 changes: 2 additions & 0 deletions
2
languages/cpp/templates/codeblocks/module-include-private.cpp
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,2 @@ | ||
${if.modules}#include "${info.title.lowercase}Impl.h" | ||
${end.if.modules}${module.includes.private} |
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,2 @@ | ||
${if.modules}#include "${info.title.lowercase}.h" | ||
${end.if.modules}${module.includes} |
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 @@ | ||
${if.modules} ${info.Title}::I${info.Title}& ${info.Title}Interface() const override | ||
{ | ||
auto module = _moduleMap.find("${info.Title}"); | ||
${info.Title}::I${info.Title}* ${info.title.lowercase} = nullptr; | ||
|
||
if (module != _moduleMap.end()) { | ||
${info.title.lowercase} = reinterpret_cast<${info.Title}::I${info.Title}*>(module->second); | ||
} else { | ||
${info.title.lowercase} = reinterpret_cast<${info.Title}::I${info.Title}*>(new ${info.Title}::${info.Title}Impl()); | ||
_moduleMap.emplace("${info.Title}", reinterpret_cast<IModule*>(${info.title.lowercase})); | ||
} | ||
return *${info.title.lowercase}; | ||
} | ||
|
||
${end.if.modules}${module.init} |
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,3 @@ | ||
${if.modules} virtual ${info.Title}::I${info.Title}& ${info.Title}Interface() const = 0; | ||
|
||
${end.if.modules}${module.init} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
|
||
/* ${method.rpc.name} - ${method.description} */ | ||
void ${method.Name}( ${method.signature.params}${if.params}, ${end.if.params}Firebolt::Error *err = nullptr ) | ||
{ | ||
const string method = _T("${info.title.lowercase}.${method.rpc.name}"); | ||
/* ${method.rpc.name} - ${method.description} */ | ||
void ${info.Title}Impl::${method.Name}( ${method.signature.params}${if.params}, ${end.if.params}Firebolt::Error *err ) | ||
{ | ||
const string method = _T("${info.title.lowercase}.${method.rpc.name}"); | ||
|
||
JsonObject jsonParameters; | ||
JsonObject jsonParameters; | ||
${if.params}${method.params.serialization}${end.if.params} | ||
|
||
Firebolt::Error status = FireboltSDK::Properties::Set(method, jsonParameters); | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
Firebolt::Error status = FireboltSDK::Properties::Set(method, jsonParameters); | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
|
||
return; | ||
} | ||
return; | ||
} |
File renamed without changes.
Empty file.
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,4 @@ | ||
// signature callback params: ${event.signature.callback.params} | ||
// method result properties : ${method.result.properties} | ||
void Subscribe( ${event.signature.params}${if.event.params}, ${end.if.event.params}I${info.Title}::I${method.Name}Notification& notification, Firebolt::Error *err = nullptr ) override; | ||
void Unsubscribe( I${info.Title}::I${method.Name}Notification& notification, Firebolt::Error *err = nullptr ) override; |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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,5 @@ | ||
/* | ||
* ${method.description} | ||
* ${method.params} | ||
*/ | ||
${method.signature.result} ${method.Name}( ${method.signature.params}${if.params}, ${end.if.params}Firebolt::Error *err = nullptr ) const override; |
Empty file.
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,5 @@ | ||
/* | ||
* ${method.rpc.name} | ||
* ${method.description} | ||
*/ | ||
void ${method.Name}( ${method.signature.params}${if.params}, ${end.if.params}Firebolt::Error *err = nullptr ) 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 |
---|---|---|
@@ -1,33 +1,35 @@ | ||
/* ${method.rpc.name} - ${method.description} */ | ||
static void ${info.Title}${method.Name}InnerCallback( void* notification, const void* userData, void* jsonResponse ) | ||
{ | ||
/* ${method.rpc.name} - ${method.description} */ | ||
static void ${info.Title}${method.Name}InnerCallback( void* notification, const void* userData, void* jsonResponse ) | ||
{ | ||
${event.callback.params.serialization} | ||
ASSERT(proxyResponse->IsValid() == true); | ||
ASSERT(proxyResponse->IsValid() == true); | ||
|
||
if (proxyResponse->IsValid() == true) { | ||
if (proxyResponse->IsValid() == true) { | ||
${event.callback.result.instantiation} | ||
proxyResponse->Release(); | ||
proxyResponse->Release(); | ||
|
||
I${method.Name}Notification& notifier = *(reinterpret_cast<I${method.Name}Notification*>(notification)); | ||
notifier.${method.Name}(${event.callback.response.instantiation}); | ||
} | ||
I${info.Title}::I${method.Name}Notification& notifier = *(reinterpret_cast<I${info.Title}::I${method.Name}Notification*>(notification)); | ||
notifier.${method.Name}(${event.callback.response.instantiation}); | ||
} | ||
void Subscribe( ${event.signature.params}${if.event.params}, ${end.if.event.params}I${method.Name}Notification& notification, Firebolt::Error *err = nullptr ) | ||
{ | ||
const string eventName = _T("${info.title.lowercase}.${method.rpc.name}"); | ||
Firebolt::Error status = Firebolt::Error::None; | ||
} | ||
void ${info.Title}Impl::Subscribe( ${event.signature.params}${if.event.params}, ${end.if.event.params}I${info.Title}::I${method.Name}Notification& notification, Firebolt::Error *err ) | ||
{ | ||
const string eventName = _T("${info.title.lowercase}.${method.rpc.name}"); | ||
Firebolt::Error status = Firebolt::Error::None; | ||
|
||
JsonObject jsonParameters; | ||
JsonObject jsonParameters; | ||
${event.params.serialization} | ||
status = FireboltSDK::Event::Instance().Subscribe<${event.result.json.type}>(eventName, jsonParameters, ${info.Title}${method.Name}InnerCallback, reinterpret_cast<void*>(¬ification), nullptr); | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
status = FireboltSDK::Event::Instance().Subscribe<${event.result.json.type}>(eventName, jsonParameters, ${info.Title}${method.Name}InnerCallback, reinterpret_cast<void*>(¬ification), nullptr); | ||
|
||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
} | ||
void ${info.Title}Impl::Unsubscribe( I${info.Title}::I${method.Name}Notification& notification, Firebolt::Error *err ) | ||
{ | ||
Firebolt::Error status = FireboltSDK::Event::Instance().Unsubscribe(_T("${info.title.lowercase}.${method.rpc.name}"), reinterpret_cast<void*>(¬ification)); | ||
|
||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
void Unsubscribe( I${method.Name}Notification& notification, Firebolt::Error *err = nullptr ) | ||
{ | ||
Firebolt::Error status = FireboltSDK::Event::Instance().Unsubscribe(_T("${info.title.lowercase}.${method.rpc.name}"), reinterpret_cast<void*>(¬ification)); | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,17 +1,18 @@ | ||
/* ${method.rpc.name} - ${method.description} */ | ||
${method.signature.result} ${method.Name}( ${method.signature.params}${if.params}, ${end.if.params}Firebolt::Error *err = nullptr ) const | ||
{ | ||
const string method = _T("${info.title.lowercase}.${method.rpc.name}"); | ||
${if.params}${method.params.serialization}${end.if.params} | ||
${method.result.json} jsonResult; | ||
/* ${method.rpc.name} - ${method.description} */ | ||
${method.signature.result} ${info.Title}Impl::${method.Name}( ${method.signature.params}${if.params}, ${end.if.params}Firebolt::Error *err ) const | ||
{ | ||
const string method = _T("${info.title.lowercase}.${method.rpc.name}"); | ||
${if.params}${method.params.serialization}${end.if.params} | ||
${method.result.json} jsonResult; | ||
${method.result.initialization} | ||
${if.params}Firebolt::Error status = FireboltSDK::Properties::Get(method, jsonParameters, jsonResult);${end.if.params} | ||
${if.params.empty}Firebolt::Error status = FireboltSDK::Properties::Get(method, jsonResult);${end.if.params.empty} | ||
if (status == Firebolt::Error::None) { | ||
${if.params}Firebolt::Error status = FireboltSDK::Properties::Get(method, jsonParameters, jsonResult);${end.if.params} | ||
${if.params.empty}Firebolt::Error status = FireboltSDK::Properties::Get(method, jsonResult);${end.if.params.empty} | ||
if (status == Firebolt::Error::None) { | ||
${method.result.instantiation} | ||
} | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
return ${method.result.name}; | ||
}${method.setter} | ||
} | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
|
||
return ${method.result.name}; | ||
}${method.setter} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.