Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization - LMStype #100

Open
Phibedy opened this issue Aug 17, 2016 · 1 comment
Open

Serialization - LMStype #100

Phibedy opened this issue Aug 17, 2016 · 1 comment

Comments

@Phibedy
Copy link
Member

Phibedy commented Aug 17, 2016

Check if the dataChannel has a method called

LMSType getLMSType()
LMSType has an id, name,...

We could create a macrp LMSTYPE(ClassName,namespace) which sets the classname as the name and the hash(classname,namespace) as id.

Furthermore we could introduce an init() function to libraries. This init function would provide all classes with it's LMSTypes.
It would be needed for deserialization (LMS GUI) + it would enable us to have polymorphic datachannels

@Phibedy
Copy link
Member Author

Phibedy commented Sep 24, 2016

We could add

extern "C" getLMSTypes(){
vector vec;
vec.add(LMSTYPE(<Type>));
return vec;

to each library. (LMSTYPE(<Type>) creates a struct with a ID and a function to get the DataChannel object. Therefore we can use the DataChannel functions to check if it is serializable/castable too, etc.
LMS could offer a feature to map the LMSTYPE-structs to their keys. As the id might be namespace1_namespace2_classname, we could set the id in the datachannel for each module and the datachannel would match the current one even if the type is polymorphic.

If one LMS instance wants data from another, we could send the ID, therefore we could create and use an instance of the object "without knowing" the type. The libraries have to be still available and loaded so the LMSTYPES are set. An service could do it easily. The libraries could be copied in the config-directory.

If the user now uses protobuffers #106, version checking would be enabled automatically, but as our datachannels should still be able to contain functions, protobuffers aren't the solution. As most of the time, the proto buffer sould be used as a container inside a class and the class still has to be available for the receiver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant