Add funciton to remove all data record groups

Refs #350
This commit is contained in:
Derek Bankieris 2016-11-29 11:47:10 -06:00
parent 4281b92141
commit d859ac8453
4 changed files with 14 additions and 0 deletions

View File

@ -70,6 +70,9 @@ namespace Trick {
/** @brief Removes a data recording group. */
int remove_group(Trick::DataRecordGroup * in_group ) ;
/** @brief Removes all data recording groups. */
void remove_all_groups() ;
/** @brief Gets a data recording group. */
Trick::DataRecordGroup * get_group(std::string group_name) ;

View File

@ -14,6 +14,7 @@ int dr_disable() ;
int dr_enable_group( const char * in_name ) ;
int dr_disable_group( const char * in_name ) ;
int dr_record_now_group( const char * in_name ) ;
void remove_all_data_record_groups() ;
#ifdef __cplusplus
int add_data_record_group( Trick::DataRecordGroup * in_group, Trick::DR_Buffering buffering = Trick::DR_Not_Specified ) ;

View File

@ -193,6 +193,12 @@ int Trick::DataRecordDispatcher::remove_group(Trick::DataRecordGroup * in_group)
return 0 ;
}
void Trick::DataRecordDispatcher::remove_all_groups() {
while (!groups.empty()) {
remove_group(groups[0]);
}
}
Trick::DataRecordGroup * Trick::DataRecordDispatcher::get_group(std::string in_name) {
std::vector <Trick::DataRecordGroup *>::iterator it ;
for ( it = groups.begin() ; it != groups.end() ; it++ ) {

View File

@ -68,6 +68,10 @@ extern "C" int remove_data_record_group( Trick::DataRecordGroup * in_group ) {
return -1 ;
}
extern "C" void remove_all_data_record_groups() {
the_drd->remove_all_groups() ;
}
extern "C" Trick::DataRecordGroup * get_data_record_group( std::string in_name ) {
if ( the_drd != NULL ) {
return the_drd->get_group(in_name) ;