Logo Search packages:      
Sourcecode: narval version File versions  Download package

libexample_cpp.cc

#include "my_class.h"

my_class my_object;
static unsigned int next_id = 0;
extern "C" {
/* you must have the following symbols */
/* see John Cresswell document for details : */
/* AGATA PSA and Tracking Algorithm Integration*/
void process_config (char *directory_path, unsigned int *error_code);
my_class *process_register (unsigned int *error_code);
void process_block (my_class *algo_data,
                void *input_buffer,
                    unsigned int size_of_input_buffer,
                void *output_buffer,
                unsigned int size_of_output_buffer,
                unsigned int *used_size_of_output_buffer,
                unsigned int *error_code);
/* optionnal symbols */
/* this symbol isn't documented for the moment, it should contain 0 or the */
/* maximum size of one event, value 0 is safe */
int max_size = 0;
void process_initialise (my_class *algo_data,
                   unsigned int *error_code);
void process_reset (my_class *algo_data,
                unsigned int *error_code);
void process_start (my_class *algo_data,
                unsigned int *error_code);
void process_stop (my_class *algo_data,
               unsigned int *error_code);
void process_pause (my_class *algo_data,
                unsigned int *error_code);
void process_resume (my_class *algo_data,
                 unsigned int *error_code);
void process_unload (my_class *algo_data,
                 unsigned int *error_code);
};

/* coding region */

void process_config (char *directory_path, unsigned int *error_code)
{
  my_object.process_config (directory_path, error_code);
}

my_class *process_register (unsigned int *error_code)
{
  my_object.set_id (next_id);
  next_id++;
  return (my_class *) my_object.process_register (error_code);
}

void process_block (my_class *algo_data,
                void *input_buffer,
                    unsigned int size_of_input_buffer,
                void *output_buffer,
                unsigned int size_of_output_buffer,
                unsigned int *used_size_of_output_buffer,
                unsigned int *error_code)
{
  algo_data->process_block (input_buffer, size_of_input_buffer,
                      output_buffer, size_of_output_buffer,
                      used_size_of_output_buffer, error_code);
}

void process_initialise (my_class *algo_data,
                   unsigned int *error_code)
{
  algo_data->process_initialise (error_code);
}
void process_reset (my_class *algo_data,
                unsigned int *error_code)
{
  algo_data->process_reset (error_code);
}
void process_start (my_class *algo_data,
                unsigned int *error_code)
{
  algo_data->process_start (error_code);
}
void process_stop (my_class *algo_data,
               unsigned int *error_code)
{
  algo_data->process_stop (error_code);
}
void process_pause (my_class *algo_data,
                unsigned int *error_code)
{
  algo_data->process_pause (error_code);
}
void process_resume (my_class *algo_data,
                 unsigned int *error_code)
{
  algo_data->process_resume (error_code);
}
void process_unload (my_class *algo_data,
                 unsigned int *error_code)
{
  algo_data->process_unload (error_code);
}

Generated by  Doxygen 1.6.0   Back to index