Mercurial > hg > aimc
comparison trunk/doc/ModuleTemplate.cc @ 284:fb52ca0e6339
-Profile module for taking slices of an SAI or SSI (or anything else for that matter)
-Stub SSI module - not yet complete
-Fixes to the module template
author | tomwalters |
---|---|
date | Fri, 19 Feb 2010 13:07:54 +0000 |
parents | ef14c9f2c1d2 |
children | 30dde71d0230 |
comparison
equal
deleted
inserted
replaced
283:ef14c9f2c1d2 | 284:fb52ca0e6339 |
---|---|
38 // store, they return the current value. If the parameter doesn't already | 38 // store, they return the current value. If the parameter doesn't already |
39 // exist, it is added, set to the default value given, and that value is | 39 // exist, it is added, set to the default value given, and that value is |
40 // returned. | 40 // returned. |
41 // Examples: | 41 // Examples: |
42 // integer_param_ = parameters_->DefaultInt("module.param_name", 4); | 42 // integer_param_ = parameters_->DefaultInt("module.param_name", 4); |
43 // boolean_param_ = parameters_->DefaultBool("module.param_name", True); | 43 // boolean_param_ = parameters_->DefaultBool("module.param_name", true); |
44 // float_param_ = parameters_->DefaultFloat("module.param_name", 4.4f); | 44 // float_param_ = parameters_->DefaultFloat("module.param_name", 4.4f); |
45 } | 45 } |
46 | 46 |
47 #MODULE_NAME#::~#MODULE_NAME#() { | 47 #MODULE_NAME#::~#MODULE_NAME#() { |
48 } | 48 } |
69 | 69 |
70 void #MODULE_NAME#::Process(const SignalBank &input) { | 70 void #MODULE_NAME#::Process(const SignalBank &input) { |
71 // Check to see if the module has been initialized. If not, processing | 71 // Check to see if the module has been initialized. If not, processing |
72 // should not continue. | 72 // should not continue. |
73 if (!initialized_) { | 73 if (!initialized_) { |
74 LOG_ERROR(_T("Module #MODULE_NAME# not initialized.")); | 74 LOG_ERROR(_T("Module %s not initialized."), module_identifier_.c_str()); |
75 return; | 75 return; |
76 } | 76 } |
77 | 77 |
78 // Check that ths input this time is the same as the input passed to | 78 // Check that ths input this time is the same as the input passed to |
79 // Initialize() | 79 // Initialize() |
80 if (buffer_length_ != input.buffer_length() | 80 if (buffer_length_ != input.buffer_length() |
81 || channel_count_ != input.channel_count()) { | 81 || channel_count_ != input.channel_count()) { |
82 LOG_ERROR(_T("Mismatch between input to Initialize() and input to " | 82 LOG_ERROR(_T("Mismatch between input to Initialize() and input to " |
83 "Process() in module %s", module_identifier_)); | 83 "Process() in module %s."), module_identifier_.c_str()); |
84 return; | 84 return; |
85 } | 85 } |
86 | 86 |
87 // Input is read from the input signal bank using calls like | 87 // Input is read from the input signal bank using calls like |
88 // float value = input_.sample(channel_number, sample_index); | 88 // float value = input_.sample(channel_number, sample_index); |