Library manifest description functions and types. More...
Typedefs | |
typedef void *(* | cd_library_description_function_t )() |
Type signature for a library's cd_library_manifest function. | |
Functions | |
void * | cd_create_library_manifest (const char *identifier, const char *library_name, const char *library_description) |
Create and initialize a library manifest object to describe the containing library. | |
void | cd_add_module (void *manifest, const char *system_name, const char *module_name, const char *module_type, const char *module_description) |
Add a description of a module contained within the library to a previously created manifest object. |
Library manifest description functions and types.
All external libraries containing CD modules should contain a manifest description function. The manifest documents the modules in the bundle for use in the ControlDeckManager utility. This provides a graphical interface for building ControlDeck files.
The manifest function signature should conform to cd_library_description_function_t and be named "cd_library_manifest". This function will in turn use the functions in this module to create and fill out a manifest describing the library. Specifically, first the function should call cd_create_library_manifest() to initialize a manifest object describing the containing library. It should then call cd_add_module() as many times as necessary to describe the modules contained within the library, and should finally return the created manifest object.
Here is a prototype:
/* * cd_manifest.cc * ControlDeck * * Created by David Hoerl on 6/28/10. * Copyright 2010 Princeton Satellite Systems. All rights reserved. * */ /* PROTOTYPE FOR A MANIFEST FUNCTION. COPY AND PASTE THIS INTO A PROJECT FILE, THEN EXPAND */ // Remove the (if 0/endif) when implementing in your own library. #if 0 #include <ControlDeck2/cd_manifest.h> void *cd_library_manifest(void) { //void *cd_create_library_manifest(const char *identifier,const char *library_name,const char *library_description); void *manifest = cd_create_library_manifest("com.psatellite.cd.<unique name>","<Library Name>","<Library Description>"); //void cd_add_module(void *manifest,const char *system_name,const char *module_name,const char *module_type,const char *module_description); cd_add_module(manifest,"<System Name>","<Module Name>","<Module Type>","<Description>"); ... return manifest; } #endif
void cd_add_module | ( | void * | manifest, |
const char * | system_name, | ||
const char * | module_name, | ||
const char * | module_type, | ||
const char * | module_description | ||
) |
Add a description of a module contained within the library to a previously created manifest object.
Use this function in the manifest function for your library, to add the modules along with a description that will be displayed in ControlDeckManager.
manifest | The manifest description object for the library, created via cd_create_library_manifest() |
system_name | The system containing the module. |
module_name | The module's name. |
module_type | The module's type (class). |
module_description | A human readable description of the operation of this module. |
void* cd_create_library_manifest | ( | const char * | identifier, |
const char * | library_name, | ||
const char * | library_description | ||
) |
Create and initialize a library manifest object to describe the containing library.
Use this function in the manifest function for your library, to create the manifest. The manifest is returned by the function after you have added the modules using cd_add_module().
identifier | An identifier for the described library, expected to be in reverse-dns notation (ie, com.psatellite.example). Used to uniquely identify this library. |
library_name | A human-readable name to be displayed to users when the library is referred to. |
library_description | A human-readable description of the library for the benefit of users. |