-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switching to codelib.{cc,h} generated by
codelib-gen
- Loading branch information
Showing
4 changed files
with
63 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,32 +15,49 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @author "Parthipan Ramesh <[email protected]>" | ||
* @author "Oliver Schranz <[email protected]>" | ||
* | ||
*/ | ||
|
||
#include "codelib.h" | ||
|
||
const std::string TemplateCodeLib::INJECTION_ARTIST_TARGET("Lsaarland/cispa/artist/codelib/CodeLib;injectionArtistTarget(I)V"); | ||
const std::string TemplateCodeLib::BASIC_ARTIST_TARGET("Lsaarland/cispa/artist/codelib/CodeLib;basicArtistTarget(ILjava/lang/Object;)V"); | ||
|
||
// CODE_GENERATOR ////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// METHODS ////////////////////////////////// | ||
const string TemplateCodeLib::_M_SAARLAND_CISPA_ARTIST_CODELIB_CODELIB__BASICARTISTTARGET__IL__V = | ||
"Lsaarland/cispa/artist/codelib/CodeLib;basicArtistTarget(ILjava/lang/Object;)V"; | ||
const string TemplateCodeLib::_M_SAARLAND_CISPA_ARTIST_CODELIB_CODELIB__INJECTIONARTISTTARGET__I__V = | ||
"Lsaarland/cispa/artist/codelib/CodeLib;injectionArtistTarget(I)V"; | ||
|
||
// FIELDS /////////////////////////////////// | ||
const string TemplateCodeLib::_F_CODECLASS_INSTANCE = | ||
"Lsaarland/cispa/artist/codelib/CodeLib;INSTANCE"; | ||
|
||
// CLASSES ////////////////////////////////// | ||
const string TemplateCodeLib::_C_JAVA_LANG_STRING = | ||
"Ljava/lang/String;"; | ||
const string TemplateCodeLib::_C_JAVA_LANG_OBJECT = | ||
"Ljava/lang/Object;"; | ||
const string TemplateCodeLib::_C_CODECLASS = | ||
"Lsaarland/cispa/artist/codelib/CodeLib;"; | ||
|
||
unordered_set<string> &TemplateCodeLib::getMethods() const { | ||
// here we expose the signatures of codelib methods that are meant to be used from ARTist | ||
static unordered_set<string> methods({INJECTION_ARTIST_TARGET, BASIC_ARTIST_TARGET}); | ||
return methods; | ||
static unordered_set<string> methods({ | ||
TemplateCodeLib::_M_SAARLAND_CISPA_ARTIST_CODELIB_CODELIB__BASICARTISTTARGET__IL__V, | ||
TemplateCodeLib::_M_SAARLAND_CISPA_ARTIST_CODELIB_CODELIB__INJECTIONARTISTTARGET__I__V, | ||
}); | ||
return methods; | ||
} | ||
|
||
string &TemplateCodeLib::getInstanceField() const { | ||
// here we expose the static field with our singleton instance. This will be used by ARTist to obtain an instance | ||
// of the codelib to call methods on it. | ||
static string instanceField = "Lsaarland/cispa/artist/codelib/CodeLib;INSTANCE"; | ||
return instanceField; | ||
static string instanceField = TemplateCodeLib::_F_CODECLASS_INSTANCE; | ||
return instanceField; | ||
} | ||
|
||
string &TemplateCodeLib::getCodeClass() const { | ||
// here we expose the codelib's java class to be able to load it in ARTist | ||
static string codeClass = "Lsaarland/cispa/artist/codelib/CodeLib;"; | ||
return codeClass; | ||
static string codeClass = TemplateCodeLib::_C_CODECLASS; | ||
return codeClass; | ||
} | ||
|
||
|
||
// CODE_GENERATOR END ////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
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 |
---|---|---|
|
@@ -15,13 +15,11 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @author "Parthipan Ramesh <[email protected]>" | ||
* @author "Oliver Schranz <[email protected]>" | ||
* | ||
*/ | ||
|
||
#ifndef ART_MODULES_CODELIB_H_ | ||
#define ART_MODULES_CODELIB_H_ | ||
#ifndef ART_MODULES_TEMPLATE_TEMPLATE_CODELIB_H_ | ||
#define ART_MODULES_TEMPLATE_TEMPLATE_CODELIB_H_ | ||
|
||
|
||
#include <string> | ||
#include <unordered_set> | ||
|
@@ -33,28 +31,31 @@ using std::unordered_set; | |
using art::CodeLib; | ||
|
||
class TemplateCodeLib : public CodeLib { | ||
public: | ||
static const string INJECTION_ARTIST_TARGET; | ||
static const string BASIC_ARTIST_TARGET; | ||
|
||
|
||
TemplateCodeLib() = default; | ||
|
||
TemplateCodeLib(const TemplateCodeLib &other) = default; | ||
|
||
TemplateCodeLib(TemplateCodeLib &&other) = default; | ||
|
||
~TemplateCodeLib() override = default; | ||
|
||
TemplateCodeLib &operator=(const TemplateCodeLib &) = default; | ||
|
||
TemplateCodeLib &operator=(TemplateCodeLib &&) = default; | ||
|
||
unordered_set<string> &getMethods() const override; | ||
|
||
string &getInstanceField() const override; | ||
|
||
string &getCodeClass() const override; | ||
public: | ||
// METHODS ////////////////////////////////// | ||
static const string _M_SAARLAND_CISPA_ARTIST_CODELIB_CODELIB__BASICARTISTTARGET__IL__V; | ||
static const string _M_SAARLAND_CISPA_ARTIST_CODELIB_CODELIB__INJECTIONARTISTTARGET__I__V; | ||
// FIELDS /////////////////////////////////// | ||
static const string _F_CODECLASS_INSTANCE; | ||
// CLASSES ////////////////////////////////// | ||
static const string _C_JAVA_LANG_STRING; | ||
static const string _C_JAVA_LANG_OBJECT; | ||
static const string _C_CODECLASS; | ||
|
||
public: | ||
TemplateCodeLib() = default; | ||
TemplateCodeLib(const TemplateCodeLib& other) = default; | ||
TemplateCodeLib(TemplateCodeLib&& other) = default; | ||
|
||
~TemplateCodeLib() override = default; | ||
|
||
TemplateCodeLib& operator=(const TemplateCodeLib&) = default; | ||
TemplateCodeLib& operator=(TemplateCodeLib&&) = default; | ||
|
||
unordered_set<string>& getMethods() const override; | ||
string& getInstanceField() const override; | ||
string& getCodeClass() const override; | ||
}; // class TemplateCodeLib | ||
|
||
#endif // ART_MODULES_CODELIB_H_ | ||
|
||
#endif // ART_MODULES_TEMPLATE_TEMPLATE_CODELIB_H_ |
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