-
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 (#139) CPPSDK: aggregate files based on suffix type handling added, module and override module generation also handled
- Loading branch information
1 parent
1f2854b
commit 7031fc2
Showing
60 changed files
with
635 additions
and
315 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,16 @@ | ||
|
||
/* ${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; | ||
${if.params}${method.params.serialization}${end.if.params} | ||
|
||
Firebolt::Error status = FireboltSDK::Properties::Set(method, jsonParameters); | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
|
||
return; | ||
} |
File renamed without changes.
File renamed without changes.
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; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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; |
File renamed without changes.
File renamed without changes.
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; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
#include "jsondata_${info.title.lowercase}.h" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
/* ${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); | ||
|
||
if (proxyResponse->IsValid() == true) { | ||
${event.callback.result.instantiation} | ||
proxyResponse->Release(); | ||
|
||
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 ${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; | ||
${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; | ||
} | ||
} | ||
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; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
/* ${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) { | ||
${method.result.instantiation} | ||
} | ||
if (err != nullptr) { | ||
*err = status; | ||
} | ||
|
||
return ${method.result.name}; | ||
}${method.setter} |
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
Oops, something went wrong.