mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 12:56:26 +00:00
Pre-increment (rather than post-increment) STL iterators in for loops… (#1692)
* Pre-increment (rather than post-increment) STL iterators in for loops. #1594 * Fix a goof. #1594
This commit is contained in:
parent
e515144252
commit
5065d96a15
@ -61,7 +61,7 @@ namespace Trick {
|
||||
*/
|
||||
void print_nonzero_diffs() {
|
||||
std::map<std::string, ClassSizeDiffInfo>::iterator it ;
|
||||
for ( it = name_to_diff.begin() ; it != name_to_diff.end() ; it++ ) {
|
||||
for ( it = name_to_diff.begin() ; it != name_to_diff.end() ; ++it ) {
|
||||
int curr_diff = it->second.diff ;
|
||||
ATTRIBUTES * attr = Trick::AttributesMap::attributes_map()->get_attr(it->first) ;
|
||||
unsigned int ii ;
|
||||
|
@ -64,7 +64,7 @@ int checkpoint_sequence_i(STL & in_stl , std::string object_name , std::string v
|
||||
//message_publish(1, "CHECKPOINT_SEQUENCE_STL with %s\n", var_declare) ;
|
||||
|
||||
/* copy the contents of the stl */
|
||||
for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; it++ , ii++ ) {
|
||||
for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; ++it , ii++ ) {
|
||||
items[ii] = *it ;
|
||||
}
|
||||
}
|
||||
@ -103,7 +103,7 @@ int checkpoint_sequence_s(STL & in_stl , std::string object_name , std::string v
|
||||
//message_publish(1, "CHECKPOINT_SEQUENCE_STL_STL with %s\n", temp_str.c_str()) ;
|
||||
|
||||
/* create the names of the sub stl checkpoint names we're going to be using */
|
||||
for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; it++ , ii++ ) {
|
||||
for ( ii = 0 , it = in_stl.begin() , end = in_stl.end() ; it != end ; ++it , ii++ ) {
|
||||
std::ostringstream sub_elements ;
|
||||
sub_elements << object_name << "_" << var_name << "_" << ii ;
|
||||
items[ii] = sub_elements.str() ;
|
||||
|
@ -19,7 +19,7 @@ int Trick::SegmentedExecutive::add_segment( Trick::Segment * ps ) {
|
||||
|
||||
// Gets the job class to job queue map for this segment and adds the job classes to the executive.
|
||||
std::map < std::string , Trick::ScheduledJobQueue * >::iterator it ;
|
||||
for ( it = ps->get_job_queues().begin() ; it != ps->get_job_queues().end() ; it++ ) {
|
||||
for ( it = ps->get_job_queues().begin() ; it != ps->get_job_queues().end() ; ++it ) {
|
||||
class_map[(*it).first] = num_classes ;
|
||||
class_to_queue[num_classes++] = (*it).second ;
|
||||
}
|
||||
@ -41,7 +41,7 @@ int Trick::SegmentedExecutive::gather_segmented_jobs() {
|
||||
std::map < std::string , Trick::Segment * >::iterator mit ;
|
||||
std::set< std::string > segment_tags ;
|
||||
|
||||
for ( mit = segment_map.begin() ; mit != segment_map.end() ; mit++ ) {
|
||||
for ( mit = segment_map.begin() ; mit != segment_map.end() ; ++mit ) {
|
||||
segment_tags.insert((*mit).first) ;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ int Trick::SegmentedExecutive::segment_set_jobs_onoff() {
|
||||
Trick::JobData * job ;
|
||||
std::set < Trick::JobData * >::iterator it ;
|
||||
|
||||
for ( it = all_segmented_jobs.begin() ; it != all_segmented_jobs.end() ; it++ ) {
|
||||
for ( it = all_segmented_jobs.begin() ; it != all_segmented_jobs.end() ; ++it ) {
|
||||
job = *it ;
|
||||
// Test to see if the next segment is present in the job tags.
|
||||
// Set the disabled flag to the negation of the tag's presence
|
||||
@ -164,10 +164,10 @@ int Trick::SegmentedExecutive::write_s_job_execution(FILE *fp) {
|
||||
fprintf(fp, "Segment Jobs:\n") ;
|
||||
|
||||
std::map < std::string , Trick::Segment * >::iterator pmit ;
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) {
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
|
||||
Trick::Segment * pb = (*pmit).second ;
|
||||
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) {
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
|
||||
(*jqit).second->write_non_sched_queue(fp) ;
|
||||
}
|
||||
}
|
||||
@ -187,10 +187,10 @@ int Trick::SegmentedExecutive::instrument_job_before( Trick::JobData * instrumen
|
||||
|
||||
//go through all of the segmented jobs and instrument them.
|
||||
std::map < std::string , Trick::Segment * >::iterator pmit ;
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) {
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
|
||||
Trick::Segment * pb = (*pmit).second ;
|
||||
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) {
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
|
||||
(*jqit).second->instrument_before(instrument_job) ;
|
||||
}
|
||||
}
|
||||
@ -209,10 +209,10 @@ int Trick::SegmentedExecutive::instrument_job_after( Trick::JobData * instrument
|
||||
|
||||
//go through all of the segmented jobs and instrument them.
|
||||
std::map < std::string , Trick::Segment * >::iterator pmit ;
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) {
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
|
||||
Trick::Segment * pb = (*pmit).second ;
|
||||
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) {
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
|
||||
(*jqit).second->instrument_after(instrument_job) ;
|
||||
}
|
||||
}
|
||||
@ -226,10 +226,10 @@ int Trick::SegmentedExecutive::instrument_job_remove(std::string in_job) {
|
||||
Trick::Executive::instrument_job_remove( in_job ) ;
|
||||
|
||||
std::map < std::string , Trick::Segment * >::iterator pmit ;
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; pmit++ ) {
|
||||
for ( pmit = segment_map.begin() ; pmit != segment_map.end() ; ++pmit ) {
|
||||
Trick::Segment * pb = (*pmit).second ;
|
||||
std::map < std::string , Trick::ScheduledJobQueue * >::iterator jqit ;
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; jqit++ ) {
|
||||
for ( jqit = pb->get_job_queues().begin() ; jqit != pb->get_job_queues().end() ; ++jqit ) {
|
||||
(*jqit).second->instrument_remove(in_job) ;
|
||||
}
|
||||
}
|
||||
|
@ -13,14 +13,14 @@ void DrawStuff::start() {
|
||||
|
||||
void DrawStuff::step(int) {
|
||||
std::vector<DrawStuffObject *>::iterator it ;
|
||||
for( it = objects.begin() ; it != objects.end() ; it++ ) {
|
||||
for( it = objects.begin() ; it != objects.end() ; ++it ) {
|
||||
(*it)->draw() ;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawStuff::command(int cmd) {
|
||||
std::vector<DrawStuffObject *>::iterator it ;
|
||||
for( it = objects.begin() ; it != objects.end() ; it++ ) {
|
||||
for( it = objects.begin() ; it != objects.end() ; ++it ) {
|
||||
(*it)->command(cmd) ;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ ClassValues::ClassValues() :
|
||||
|
||||
ClassValues::~ClassValues() {
|
||||
std::vector<FieldDescription *>::iterator fdit ;
|
||||
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; fdit++ ) {
|
||||
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; ++fdit ) {
|
||||
delete (*fdit) ;
|
||||
}
|
||||
}
|
||||
@ -57,7 +57,7 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
|
||||
|
||||
std::vector<FieldDescription *>::iterator fdit ;
|
||||
// Loop through the incoming inherited variable names
|
||||
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; fdit++ ) {
|
||||
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; ++fdit ) {
|
||||
|
||||
(*fdit)->setBaseClassOffset( class_offset ) ;
|
||||
(*fdit)->setInherited( true ) ;
|
||||
@ -72,7 +72,7 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
|
||||
#else
|
||||
{
|
||||
#endif
|
||||
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; fdit++ ) {
|
||||
for ( fdit = in_fdes.begin() ; fdit != in_fdes.end() ; ++fdit ) {
|
||||
|
||||
std::string in_name = (*fdit)->getName() ;
|
||||
// search existing names for incoming inherited variable name.
|
||||
@ -113,7 +113,7 @@ void ClassValues::addInheritedFieldDescriptions(std::vector<FieldDescription *>
|
||||
void ClassValues::saveInheritAncestry( ClassValues * in_cv ) {
|
||||
|
||||
std::map< std::string , unsigned int >::iterator mit ;
|
||||
for ( mit = in_cv->all_inherited_class_names_map.begin() ; mit != in_cv->all_inherited_class_names_map.end() ; mit++ ) {
|
||||
for ( mit = in_cv->all_inherited_class_names_map.begin() ; mit != in_cv->all_inherited_class_names_map.end() ; ++mit ) {
|
||||
all_inherited_class_names_map[(*mit).first] += (*mit).second ;
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ void ClassValues::saveInheritAncestry( ClassValues * in_cv ) {
|
||||
void ClassValues::setContainerClassForFields() {
|
||||
std::vector<FieldDescription *>::iterator fdit ;
|
||||
// Loop through all fields
|
||||
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; fdit++ ) {
|
||||
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; ++fdit ) {
|
||||
// Prepend the field container class with the current class name.
|
||||
(*fdit)->setContainerClass( name + "::" + (*fdit)->getContainerClass() ) ;
|
||||
}
|
||||
@ -134,13 +134,13 @@ void ClassValues::clearAmbiguousVariables() {
|
||||
std::map< std::string , unsigned int >::iterator mit ;
|
||||
std::vector<FieldDescription *>::iterator fdit ;
|
||||
|
||||
for ( mit = all_inherited_class_names_map.begin() ; mit != all_inherited_class_names_map.end() ; mit++ ) {
|
||||
for ( mit = all_inherited_class_names_map.begin() ; mit != all_inherited_class_names_map.end() ; ++mit ) {
|
||||
// If a class in inherited more than once we have a diamond. We'll need to modify variables that were
|
||||
// inherited from that class.
|
||||
if ( (*mit).second > 1 ) {
|
||||
std::string str = (*mit).first + "::" ;
|
||||
// Loop through all fields testing for the diamond inherited class in the name.
|
||||
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; fdit++ ) {
|
||||
for ( fdit = field_descripts.begin() ; fdit != field_descripts.end() ; ++fdit ) {
|
||||
std::string fdit_name = (*fdit)->getName() ;
|
||||
size_t f = fdit_name.find(str) ;
|
||||
// If the variable contains the diamond class string, remove the diamond class qualification.
|
||||
|
@ -210,7 +210,7 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
|
||||
} else {
|
||||
// Test all constructors to see if any of those are the default and public
|
||||
clang::CXXRecordDecl::ctor_iterator cit ;
|
||||
for ( cit = rec->ctor_begin() ; cit != rec->ctor_end() ; cit++ ) {
|
||||
for ( cit = rec->ctor_begin() ; cit != rec->ctor_end() ; ++cit ) {
|
||||
if ( ( !(*cit)->isDeleted() ) and (*cit)->isDefaultConstructor() and (*cit)->getAccess() == clang::AS_public ) {
|
||||
cval.setHasDefaultConstructor(true) ;
|
||||
}
|
||||
@ -234,7 +234,7 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
|
||||
//std::cout << "parsing " << cval.getName() << std::endl ;
|
||||
//std::cout << " [34mprocessing inheritance " << rec->getNumBases() << " " << rec->getNumVBases() << "[00m" << std::endl ;
|
||||
clang::CXXRecordDecl::base_class_iterator bcii ;
|
||||
for ( bcii = rec->bases_begin() ; bcii != rec->bases_end() ; bcii++ ) {
|
||||
for ( bcii = rec->bases_begin() ; bcii != rec->bases_end() ; ++bcii ) {
|
||||
if ( !bcii->isVirtual() ) {
|
||||
const clang::Type * temp = bcii->getType().getTypePtr() ;
|
||||
//std::cout << "\n[33minherited Type = " << temp->getTypeClassName() << "[00m" << std::endl ;
|
||||
@ -282,7 +282,7 @@ bool CXXRecordVisitor::VisitCXXRecordDecl( clang::CXXRecordDecl *rec ) {
|
||||
// When processing inherited classes include_virtual_base will be set to true
|
||||
// so we don't process virtual inherited classes multiple times.
|
||||
if ( include_virtual_base ) {
|
||||
for ( bcii = rec->vbases_begin() ; bcii != rec->vbases_end() ; bcii++ ) {
|
||||
for ( bcii = rec->vbases_begin() ; bcii != rec->vbases_end() ; ++bcii ) {
|
||||
const clang::Type * temp = bcii->getType().getTypePtr() ;
|
||||
//std::cout << "\n[33minherited Type = " << temp->getTypeClassName() << "[00m" << std::endl ;
|
||||
const clang::RecordType * rt = temp->getAs<clang::RecordType>() ;
|
||||
|
@ -60,7 +60,7 @@ std::string CommentSaver::getTrickHeaderComment( std::string file_name ) {
|
||||
if ( resolved_path != NULL ) {
|
||||
if ( trick_header_comments.find(resolved_path) == trick_header_comments.end() ) {
|
||||
trick_header_comments[resolved_path] = std::string() ;
|
||||
for ( cit = comment_map[resolved_path].begin() ; cit != comment_map[resolved_path].end() ; cit++ ) {
|
||||
for ( cit = comment_map[resolved_path].begin() ; cit != comment_map[resolved_path].end() ; ++cit ) {
|
||||
std::string comment_str = getComment((*cit).second) ;
|
||||
if ( comment_str.find("@trick_parse") != std::string::npos or
|
||||
comment_str.find("\\trick_parse") != std::string::npos ) {
|
||||
|
@ -304,7 +304,7 @@ void FieldDescription::parseComment(std::string comment) {
|
||||
// escape special characters, convert tabs and newlines to spaces, remove multiple spaces.
|
||||
std::ostringstream ss ;
|
||||
bool is_space = false ;
|
||||
for (std::string::iterator it = comment.begin(); it != comment.end(); it++) {
|
||||
for (std::string::iterator it = comment.begin(); it != comment.end(); ++it) {
|
||||
switch (*it) {
|
||||
case '\\': ss << "\\\\"; is_space = false ; break;
|
||||
case '"': ss << "\\\""; is_space = false ; break;
|
||||
|
@ -442,7 +442,7 @@ bool FieldVisitor::VisitRecordType(clang::RecordType *rt) {
|
||||
// Test if we have some type from STL.
|
||||
if (!tst_string.compare( 0 , 5 , "std::")) {
|
||||
// If we have some type from std, figure out if it is one we support.
|
||||
for ( std::map<std::string, bool>::iterator it = stl_classes.begin() ; it != stl_classes.end() ; it++ ) {
|
||||
for ( std::map<std::string, bool>::iterator it = stl_classes.begin() ; it != stl_classes.end() ; ++it ) {
|
||||
/* Mark STL types that are not strings and exit */
|
||||
if (!tst_string.compare( 0 , (*it).first.size() , (*it).first)) {
|
||||
|
||||
|
@ -80,7 +80,7 @@ void FindTrickICG::If(clang::SourceLocation Loc, clang::SourceRange ConditionRan
|
||||
if ( ref.str().find("TRICK_ICG") != std::string::npos ) {
|
||||
// for each header in the stack, mark them as being exposed to TRICK_ICG
|
||||
std::vector<std::string>::iterator it ;
|
||||
for ( it = included_files.begin() ; it != included_files.end() ; it++ ) {
|
||||
for ( it = included_files.begin() ; it != included_files.end() ; ++it ) {
|
||||
hsd.addTrickICGFoundFile(*it) ;
|
||||
}
|
||||
// print warning messages.
|
||||
@ -124,7 +124,7 @@ void FindTrickICG::Ifdef(clang::SourceLocation Loc, const clang::Token &MacroNam
|
||||
if ( (loc_str.find("S_source.hh") == std::string::npos) ) {
|
||||
// for each header in the stack, mark them as being exposed to TRICK_ICG
|
||||
std::vector<std::string>::iterator it ;
|
||||
for ( it = included_files.begin() ; it != included_files.end() ; it++ ) {
|
||||
for ( it = included_files.begin() ; it != included_files.end() ; ++it ) {
|
||||
hsd.addTrickICGFoundFile(*it) ;
|
||||
}
|
||||
// print warning messages.
|
||||
@ -149,7 +149,7 @@ void FindTrickICG::Ifndef(clang::SourceLocation Loc, const clang::Token &MacroNa
|
||||
std::string loc_str = Loc.printToString(ci.getSourceManager()) ;
|
||||
// for each header in the stack, mark them as being exposed to TRICK_ICG
|
||||
std::vector<std::string>::iterator it ;
|
||||
for ( it = included_files.begin() ; it != included_files.end() ; it++ ) {
|
||||
for ( it = included_files.begin() ; it != included_files.end() ; ++it ) {
|
||||
hsd.addTrickICGFoundFile(*it) ;
|
||||
}
|
||||
// print warning messages.
|
||||
|
@ -186,13 +186,13 @@ void HeaderSearchDirs::ApplyHeaderSearchOptions () {
|
||||
clang::ApplyHeaderSearchOptions( hs , hso , pp.getLangOpts() , pp.getTargetInfo().getTriple() ) ;
|
||||
//clang::HeaderSearch::search_dir_iterator sdi ;
|
||||
/*
|
||||
for ( sdi = hs.quoted_dir_begin() ; sdi != hs.quoted_dir_end() ; sdi++ ) {
|
||||
for ( sdi = hs.quoted_dir_begin() ; sdi != hs.quoted_dir_end() ; ++sdi ) {
|
||||
std::cout << "quoted dir " << (*sdi).getName() << std::endl ;
|
||||
}
|
||||
for ( sdi = hs.angled_dir_begin() ; sdi != hs.angled_dir_end() ; sdi++ ) {
|
||||
for ( sdi = hs.angled_dir_begin() ; sdi != hs.angled_dir_end() ; ++sdi ) {
|
||||
std::cout << "angled dir " << (*sdi).getName() << std::endl ;
|
||||
}
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ ) {
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; ++sdi ) {
|
||||
std::cout << "system dir " << (*sdi).getName() << std::endl ;
|
||||
}
|
||||
*/
|
||||
@ -229,7 +229,7 @@ bool HeaderSearchDirs::isPathInUserDir (const std::string& in_dir ) {
|
||||
for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) )
|
||||
#else
|
||||
clang::HeaderSearch::search_dir_iterator sdi ;
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ )
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; ++sdi )
|
||||
#endif
|
||||
{
|
||||
#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported
|
||||
@ -261,7 +261,7 @@ bool HeaderSearchDirs::isPathInUserOrTrickDir (const std::string& in_dir ) {
|
||||
for ( clang::ConstSearchDirIterator sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi = std::next(sdi) )
|
||||
#else
|
||||
clang::HeaderSearch::search_dir_iterator sdi ;
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; sdi++ )
|
||||
for ( sdi = hs.system_dir_begin() ; sdi != hs.system_dir_end() ; ++sdi )
|
||||
#endif
|
||||
{
|
||||
#if (LIBCLANG_MAJOR < 4) // TODO delete when RHEL 7 no longer supported
|
||||
@ -279,7 +279,7 @@ bool HeaderSearchDirs::isPathInUserOrTrickDir (const std::string& in_dir ) {
|
||||
bool HeaderSearchDirs::isPathInExclude (const std::string& in_dir ) {
|
||||
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; vit++ ) {
|
||||
for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
return true ;
|
||||
}
|
||||
@ -291,7 +291,7 @@ bool HeaderSearchDirs::isPathInExclude (const std::string& in_dir ) {
|
||||
bool HeaderSearchDirs::isPathInICGExclude (const std::string& in_dir ) {
|
||||
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; vit++ ) {
|
||||
for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
return true ;
|
||||
}
|
||||
@ -303,7 +303,7 @@ bool HeaderSearchDirs::isPathInICGExclude (const std::string& in_dir ) {
|
||||
bool HeaderSearchDirs::isPathInExtLib (const std::string& in_dir ) {
|
||||
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; vit++ ) {
|
||||
for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
return true ;
|
||||
}
|
||||
@ -318,7 +318,7 @@ bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_dir ) {
|
||||
}
|
||||
else {
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = icg_nocomment_dirs.begin() ; vit != icg_nocomment_dirs.end() ; vit++ ) {
|
||||
for ( vit = icg_nocomment_dirs.begin() ; vit != icg_nocomment_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
icg_nocomment_files[in_dir] = true ;
|
||||
return true;
|
||||
@ -332,7 +332,7 @@ bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_dir ) {
|
||||
bool HeaderSearchDirs::isPathInCompat15 (const std::string& in_dir ) {
|
||||
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = compat15_dirs.begin() ; vit != compat15_dirs.end() ; vit++ ) {
|
||||
for ( vit = compat15_dirs.begin() ; vit != compat15_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
return true ;
|
||||
}
|
||||
@ -347,7 +347,7 @@ bool HeaderSearchDirs::isPathInCompat15 (const std::string& in_dir ) {
|
||||
std::string HeaderSearchDirs::getPathInExclude (const std::string& in_dir ) {
|
||||
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; vit++ ) {
|
||||
for ( vit = exclude_dirs.begin() ; vit != exclude_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
return (*vit) ;
|
||||
}
|
||||
@ -359,7 +359,7 @@ std::string HeaderSearchDirs::getPathInExclude (const std::string& in_dir ) {
|
||||
std::string HeaderSearchDirs::getPathInICGExclude (const std::string& in_dir ) {
|
||||
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; vit++ ) {
|
||||
for ( vit = icg_exclude_dirs.begin() ; vit != icg_exclude_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
return (*vit) ;
|
||||
}
|
||||
@ -371,7 +371,7 @@ std::string HeaderSearchDirs::getPathInICGExclude (const std::string& in_dir ) {
|
||||
std::string HeaderSearchDirs::getPathInExtLib (const std::string& in_dir ) {
|
||||
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; vit++ ) {
|
||||
for ( vit = ext_lib_dirs.begin() ; vit != ext_lib_dirs.end() ; ++vit ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
return (*vit) ;
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ void PrintAttributes::printIOMakefile() {
|
||||
<< "IO_OBJECTS =" ;
|
||||
|
||||
std::map< std::string , std::string >::iterator mit ;
|
||||
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; mit++ ) {
|
||||
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; ++mit ) {
|
||||
size_t found ;
|
||||
found = (*mit).second.find_last_of(".") ;
|
||||
makefile_io_src << " \\\n " << (*mit).second.substr(0,found) << ".o" ;
|
||||
@ -487,7 +487,7 @@ void PrintAttributes::printIOMakefile() {
|
||||
ICG_processed.open("build/ICG_processed") ;
|
||||
|
||||
makefile_ICG << "build/Makefile_io_src:" ;
|
||||
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; mit++ ) {
|
||||
for ( mit = all_io_files.begin() ; mit != all_io_files.end() ; ++mit ) {
|
||||
makefile_ICG << " \\\n " << (*mit).first ;
|
||||
size_t found ;
|
||||
found = (*mit).second.find_last_of(".") ;
|
||||
@ -518,7 +518,7 @@ void PrintAttributes::printICGNoFiles() {
|
||||
if ( ! sim_services_flag ) {
|
||||
std::vector< std::string >::iterator it ;
|
||||
std::ofstream icg_no_outfile("build/ICG_no_found") ;
|
||||
for ( it = icg_no_files.begin() ; it != icg_no_files.end() ; it++ ) {
|
||||
for ( it = icg_no_files.begin() ; it != icg_no_files.end() ; ++it ) {
|
||||
icg_no_outfile << (*it) << std::endl ;
|
||||
}
|
||||
icg_no_outfile.close() ;
|
||||
|
@ -182,7 +182,7 @@ void Trick::DataRecordDispatcher::remove_all_groups() {
|
||||
|
||||
Trick::DataRecordGroup * Trick::DataRecordDispatcher::get_group(std::string in_name) {
|
||||
std::vector <Trick::DataRecordGroup *>::iterator it ;
|
||||
for ( it = groups.begin() ; it != groups.end() ; it++ ) {
|
||||
for ( it = groups.begin() ; it != groups.end() ; ++it ) {
|
||||
if ( ! (*it)->get_group_name().compare(in_name) )
|
||||
return *it ;
|
||||
}
|
||||
|
@ -512,7 +512,7 @@ int Trick::DataRecordGroup::restart() {
|
||||
std::vector <Trick::DataRecordBuffer *>::iterator drb_it ;
|
||||
|
||||
/* delete the current rec_buffer */
|
||||
for ( drb_it = rec_buffer.begin() ; drb_it != rec_buffer.end() ; drb_it++ ) {
|
||||
for ( drb_it = rec_buffer.begin() ; drb_it != rec_buffer.end() ; ++drb_it ) {
|
||||
delete *drb_it ;
|
||||
}
|
||||
rec_buffer.clear() ;
|
||||
@ -520,7 +520,7 @@ int Trick::DataRecordGroup::restart() {
|
||||
add_time_variable() ;
|
||||
|
||||
/* delete the current change_buffer contents */
|
||||
for ( drb_it = change_buffer.begin() ; drb_it != change_buffer.end() ; drb_it++ ) {
|
||||
for ( drb_it = change_buffer.begin() ; drb_it != change_buffer.end() ; ++drb_it ) {
|
||||
delete *drb_it ;
|
||||
}
|
||||
change_buffer.clear() ;
|
||||
|
@ -44,7 +44,7 @@ int Trick::Environment::print_vars( FILE * fp ) {
|
||||
|
||||
std::map<std::string, std::string >::iterator it ;
|
||||
|
||||
for ( it = local_env.begin() ; it != local_env.end() ; it++ ) {
|
||||
for ( it = local_env.begin() ; it != local_env.end() ; ++it ) {
|
||||
fprintf(fp, "%s = %s\n", it->first.c_str(), it->second.c_str());
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ void Trick::EventProcessor::add_event(Trick::Event * in_event) {
|
||||
*/
|
||||
void Trick::EventProcessor::remove_event(Trick::Event * in_event) {
|
||||
std::multiset< Trick::Event *, CompareEventPtrs >::iterator sit = event_set.begin() ;
|
||||
for (sit=event_set.begin(); sit!=event_set.end(); sit++) {
|
||||
for (sit=event_set.begin(); sit!=event_set.end(); ++sit) {
|
||||
if ((*sit) == in_event) {
|
||||
event_set.erase(sit) ;
|
||||
break;
|
||||
|
@ -148,7 +148,7 @@ int Trick::Executive::add_job_to_queue( Trick::JobData * job ) {
|
||||
/* Add job to convienience constructs for easy retrival */
|
||||
all_jobs.insert(std::pair<std::string, JobData *>(job->name,job)) ;
|
||||
all_jobs_vector.push_back(job) ;
|
||||
for ( it = job->tags_begin() ; it != job->tags_end() ; it++ ) {
|
||||
for ( it = job->tags_begin() ; it != job->tags_end() ; ++it ) {
|
||||
all_tagged_jobs.insert(std::pair<std::string, JobData *>(*it,job)) ;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ Trick::JobData * Trick::Executive::get_job(std::string job_name, unsigned int j_
|
||||
range = all_jobs.equal_range(job_name) ;
|
||||
|
||||
/** @li Move to the j_instance-th item in the list */
|
||||
for ( it = range.first , ii = 1 ; (it != range.second) && (ii < j_instance) ; it++ , ii++ ) ;
|
||||
for ( it = range.first , ii = 1 ; (it != range.second) && (ii < j_instance) ; ++it , ii++ ) ;
|
||||
|
||||
/** @li If the j_instance-th item doesn't exist return NULL */
|
||||
if ( it == range.second ) {
|
||||
|
@ -40,7 +40,7 @@ int Trick::Executive::remove_jobs( Trick::SimObject * in_sim_object ) {
|
||||
}
|
||||
|
||||
/* search the executive queues for the job and remove it if found */
|
||||
for ( std::vector <Trick::JobData *>::iterator jit = in_sim_object->jobs.begin() ; jit != in_sim_object->jobs.end() ; jit++ ) {
|
||||
for ( std::vector <Trick::JobData *>::iterator jit = in_sim_object->jobs.begin() ; jit != in_sim_object->jobs.end() ; ++jit ) {
|
||||
std::map<std::string, int>::iterator class_id_it ;
|
||||
std::map<int, Trick::ScheduledJobQueue *>::iterator queue_it ;
|
||||
Trick::ScheduledJobQueue * curr_queue ;
|
||||
|
@ -17,7 +17,7 @@ int Trick::Executive::delete_sim_object( Trick::SimObject * in_object ) {
|
||||
std::vector <Trick::SimObject *>::iterator so_it ;
|
||||
std::vector <Trick::Scheduler *>::iterator sched_it ;
|
||||
|
||||
for ( so_it = in_object->pre_component_objects.begin() ; so_it != in_object->pre_component_objects.end() ; so_it++ ) {
|
||||
for ( so_it = in_object->pre_component_objects.begin() ; so_it != in_object->pre_component_objects.end() ; ++so_it ) {
|
||||
delete_sim_object((*so_it)) ;
|
||||
}
|
||||
|
||||
@ -31,11 +31,11 @@ int Trick::Executive::delete_sim_object( Trick::SimObject * in_object ) {
|
||||
|
||||
remove_jobs( in_object ) ;
|
||||
|
||||
for ( sched_it = other_schedulers.begin() ; sched_it != other_schedulers.end() ; sched_it++ ) {
|
||||
for ( sched_it = other_schedulers.begin() ; sched_it != other_schedulers.end() ; ++sched_it ) {
|
||||
(*sched_it)->delete_sim_object(in_object) ;
|
||||
}
|
||||
|
||||
for ( so_it = in_object->post_component_objects.begin() ; so_it != in_object->post_component_objects.end() ; so_it++ ) {
|
||||
for ( so_it = in_object->post_component_objects.begin() ; so_it != in_object->post_component_objects.end() ; ++so_it ) {
|
||||
delete_sim_object((*so_it)) ;
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,8 @@ int Trick::Executive::restart() {
|
||||
all_tagged_jobs.clear() ;
|
||||
|
||||
/* Create a temporary all_jobs map to use to restore job data from all_jobs_for_checkpoint */
|
||||
for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; sit++ ) {
|
||||
for ( jit = (*sit)->jobs.begin() ; jit != (*sit)->jobs.end() ; jit++ ) {
|
||||
for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; ++sit ) {
|
||||
for ( jit = (*sit)->jobs.begin() ; jit != (*sit)->jobs.end() ; ++jit ) {
|
||||
/* Dynamically created sim_objects, like data_recording objects, require that
|
||||
some of the job class data be repopulated before we start
|
||||
copying job data back into the sim. */
|
||||
@ -67,7 +67,7 @@ int Trick::Executive::restart() {
|
||||
message_publish(MSG_ERROR, "Could not find job %s\n", all_jobs_for_checkpoint[ii].name.c_str()) ;
|
||||
exec_terminate_with_return( -1 , __FILE__ , __LINE__ , "Job in checkpoint file does not exist in current sim." ) ;
|
||||
} else {
|
||||
for ( it = ret.first ; it != ret.second ; it++ ) {
|
||||
for ( it = ret.first ; it != ret.second ; ++it ) {
|
||||
// The JobData::id and JobData::sim_object_id together uniquely identify a job.
|
||||
if (( it->second->id == all_jobs_for_checkpoint[ii].id ) &&
|
||||
( it->second->sim_object_id == all_jobs_for_checkpoint[ii].sim_object_id )) {
|
||||
@ -80,7 +80,7 @@ int Trick::Executive::restart() {
|
||||
|
||||
/* restore the executive sim_objects vector from the checkpoint and add back all of
|
||||
the jobs to the schedulers */
|
||||
for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; sit++ ) {
|
||||
for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; ++sit ) {
|
||||
add_jobs_to_queue(*sit, true) ;
|
||||
for ( ii = 0 ; ii < other_schedulers.size() ; ii++ ) {
|
||||
other_schedulers[ii]->add_sim_object(*sit) ;
|
||||
|
@ -27,7 +27,7 @@ int Trick::Executive::set_job_cycle(std::string job_name, int instance_num, doub
|
||||
range = all_tagged_jobs.equal_range(job_name) ;
|
||||
if (range.first != range.second) {
|
||||
// set cycle for all jobs with this tag
|
||||
for ( it = range.first; it != range.second ; it++ ) {
|
||||
for ( it = range.first; it != range.second ; ++it ) {
|
||||
(*it).second->set_cycle(in_cycle) ;
|
||||
(*it).second->set_next_call_time(time_tics) ;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ int Trick::Executive::set_job_onoff(std::string job_name, int instance_num , int
|
||||
range = all_tagged_jobs.equal_range(job_name) ;
|
||||
if (range.first != range.second) {
|
||||
// set disabled flag accordingly for all jobs with this tag
|
||||
for ( it = range.first; it != range.second ; it++ ) {
|
||||
for ( it = range.first; it != range.second ; ++it ) {
|
||||
it->second->disabled = !on ;
|
||||
}
|
||||
} else {
|
||||
|
@ -33,7 +33,7 @@ int Trick::FrameDataRecordGroup::frame_log_clear() {
|
||||
return 0 ;
|
||||
}
|
||||
std::vector< Trick::JobData *>::iterator it ;
|
||||
for ( it = rec_jobs.begin() ; it != rec_jobs.end() ; it++ ) {
|
||||
for ( it = rec_jobs.begin() ; it != rec_jobs.end() ; ++it ) {
|
||||
(*it)->frame_time = 0 ;
|
||||
(*it)->frame_time_seconds = 0.0;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ void Trick::FrameLog::add_recording_vars_for_jobs() {
|
||||
|
||||
/* set the recoring job be and end of frame job. Set each recording group to it's proper thread. */
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
|
||||
for ( fdrg_it = drg_users.begin() , ii = 0 ; fdrg_it != drg_users.end() ; fdrg_it++ , ii++ ) {
|
||||
for ( fdrg_it = drg_users.begin() , ii = 0 ; fdrg_it != drg_users.end() ; ++fdrg_it , ii++ ) {
|
||||
(*fdrg_it)->set_job_class("end_of_frame") ;
|
||||
(*fdrg_it)->set_phase(65533);
|
||||
(*fdrg_it)->set_thread(ii);
|
||||
@ -251,7 +251,7 @@ void Trick::FrameLog::add_recording_vars_for_frame() {
|
||||
*/
|
||||
void Trick::FrameLog::add_recording_groups_to_sim() {
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) {
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
|
||||
add_data_record_group( *fdrg_it , Trick::DR_Ring_Buffer) ;
|
||||
}
|
||||
add_data_record_group(drg_trick, Trick::DR_Ring_Buffer) ;
|
||||
@ -267,7 +267,7 @@ void Trick::FrameLog::add_recording_groups_to_sim() {
|
||||
*/
|
||||
void Trick::FrameLog::remove_recording_groups_from_sim() {
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) {
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
|
||||
remove_data_record_group( *fdrg_it) ;
|
||||
}
|
||||
remove_data_record_group(drg_trick) ;
|
||||
@ -283,7 +283,7 @@ void Trick::FrameLog::remove_recording_groups_from_sim() {
|
||||
*/
|
||||
void Trick::FrameLog::enable_recording_groups() {
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) {
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
|
||||
(*fdrg_it)->enable() ;
|
||||
}
|
||||
drg_trick->enable() ;
|
||||
@ -299,7 +299,7 @@ void Trick::FrameLog::enable_recording_groups() {
|
||||
*/
|
||||
void Trick::FrameLog::disable_recording_groups() {
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) {
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
|
||||
(*fdrg_it)->disable() ;
|
||||
}
|
||||
drg_trick->disable() ;
|
||||
@ -315,7 +315,7 @@ void Trick::FrameLog::disable_recording_groups() {
|
||||
*/
|
||||
void Trick::FrameLog::init_recording_groups() {
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator fdrg_it ;
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; fdrg_it++ ) {
|
||||
for ( fdrg_it = drg_users.begin() ; fdrg_it != drg_users.end() ; ++fdrg_it ) {
|
||||
(*fdrg_it)->init() ;
|
||||
}
|
||||
drg_trick->init() ;
|
||||
@ -481,7 +481,7 @@ int Trick::FrameLog::set_max_samples(int num) {
|
||||
timeline_other[ii] = (Trick::timeline_t *)realloc( timeline_other[ii], tl_max_samples*sizeof(Trick::timeline_t));
|
||||
}
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator it ;
|
||||
for ( it = drg_users.begin() ; it != drg_users.end() ; it++ ) {
|
||||
for ( it = drg_users.begin() ; it != drg_users.end() ; ++it ) {
|
||||
(*it)->set_max_buffer_size(num) ;
|
||||
}
|
||||
drg_trick->set_max_buffer_size(num) ;
|
||||
@ -527,7 +527,7 @@ int Trick::FrameLog::clear_data_record_info() {
|
||||
remove_recording_groups_from_sim() ;
|
||||
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator it ;
|
||||
for ( it = drg_users.begin() ; it != drg_users.end() ; it++ ) {
|
||||
for ( it = drg_users.begin() ; it != drg_users.end() ; ++it ) {
|
||||
(*it)->clear_checkpoint_vars() ;
|
||||
}
|
||||
drg_trick->clear_checkpoint_vars() ;
|
||||
@ -549,7 +549,7 @@ clear_data_record_info.
|
||||
int Trick::FrameLog::restart() {
|
||||
// removing the data record groups removed the restart jobs too. call them here.
|
||||
std::vector< Trick::FrameDataRecordGroup *>::iterator it ;
|
||||
for ( it = drg_users.begin() ; it != drg_users.end() ; it++ ) {
|
||||
for ( it = drg_users.begin() ; it != drg_users.end() ; ++it ) {
|
||||
(*it)->restart() ;
|
||||
}
|
||||
drg_trick->restart() ;
|
||||
@ -844,7 +844,7 @@ int Trick::FrameLog::create_DP_job_files() {
|
||||
total_plots = drg_users[ii]->rec_buffer.size();
|
||||
std::vector <Trick::DataRecordBuffer *>::iterator drb_it ;
|
||||
bg_color = (char *)"cornsilk2";
|
||||
for ( drb_it = drg_users[ii]->rec_buffer.begin() + 1 ; drb_it != drg_users[ii]->rec_buffer.end() ; drb_it++ ) {
|
||||
for ( drb_it = drg_users[ii]->rec_buffer.begin() + 1 ; drb_it != drg_users[ii]->rec_buffer.end() ; ++drb_it ) {
|
||||
if ( ! (*drb_it)->name.compare(0, 5, "frame") ) continue ;
|
||||
// plots_per_page job plots per page
|
||||
if ((plots == 0) || (plots > plots_per_page)) {
|
||||
|
@ -46,7 +46,7 @@ static PyThreadState *_save = NULL;
|
||||
void Trick::IPPython::get_TMM_named_variables() {
|
||||
//std::cout << "top level names at initialization" << std::endl ;
|
||||
Trick::ALLOC_INFO_MAP_ITER aim_it ;
|
||||
for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; aim_it++ ) {
|
||||
for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; ++aim_it ) {
|
||||
ALLOC_INFO * alloc_info = (*aim_it).second ;
|
||||
if ( alloc_info->name != NULL and alloc_info->user_type_name != NULL ) {
|
||||
std::stringstream ss ;
|
||||
|
@ -264,7 +264,7 @@ int Trick::JITInputFile::add_library(std::string lib_name) {
|
||||
|
||||
void * Trick::JITInputFile::find_symbol(std::string sym) {
|
||||
std::map< std::string , JITLibInfo >::iterator it ;
|
||||
for ( it = file_to_libinfo_map.begin() ; it != file_to_libinfo_map.end() ; it++ ) {
|
||||
for ( it = file_to_libinfo_map.begin() ; it != file_to_libinfo_map.end() ; ++it ) {
|
||||
void * ret = (*it).second.find_symbol(sym) ;
|
||||
if (ret != NULL) {
|
||||
return ret ;
|
||||
|
@ -225,7 +225,7 @@ int Trick::JSONVariableServerThread::get_vars( std::stringstream & body , char *
|
||||
if ( path[0] == '\0' ) {
|
||||
Trick::ALLOC_INFO_MAP_ITER aim_it ;
|
||||
bool first_item = true ;
|
||||
for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; aim_it++ ) {
|
||||
for ( aim_it = trick_MM->alloc_info_map_begin() ; aim_it != trick_MM->alloc_info_map_end() ; ++aim_it ) {
|
||||
ALLOC_INFO * alloc_info = (*aim_it).second ;
|
||||
if ( alloc_info->name != NULL and alloc_info->user_type_name != NULL ) {
|
||||
if ( first_item == true ) {
|
||||
|
@ -80,7 +80,7 @@ Trick::MemoryManager::~MemoryManager() {
|
||||
|
||||
delete defaultCheckPointAgent ;
|
||||
|
||||
for ( ait = alloc_info_map.begin() ; ait != alloc_info_map.end() ; ait++ ) {
|
||||
for ( ait = alloc_info_map.begin() ; ait != alloc_info_map.end() ; ++ait ) {
|
||||
ALLOC_INFO * ai_ptr = (*ait).second ;
|
||||
if (ai_ptr->stcl == TRICK_LOCAL) {
|
||||
if ( ai_ptr->alloc_type == TRICK_ALLOC_MALLOC ) {
|
||||
|
@ -1294,7 +1294,7 @@ TEST_F(MM_stl_checkpoint, recursive_nightmare ) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
|
||||
int j = 0;
|
||||
for (auto it = recursive_nightmare_copy[i].begin(); it != recursive_nightmare_copy[i].end(); it++, j++) {
|
||||
for (auto it = recursive_nightmare_copy[i].begin(); it != recursive_nightmare_copy[i].end(); ++it, j++) {
|
||||
std::pair<int,int> key = it->first;
|
||||
std::vector<std::stack<std::string>> val = it->second;
|
||||
|
||||
|
@ -63,7 +63,7 @@ int Trick::MessagePublisher::publish(int level , std::string message) {
|
||||
|
||||
/** @li Go through all its subscribers and send a message update to the subscriber that is enabled. */
|
||||
if ( ! subscribers.empty() ) {
|
||||
for ( p = subscribers.begin() ; p != subscribers.end() ; p++ ) {
|
||||
for ( p = subscribers.begin() ; p != subscribers.end() ; ++p ) {
|
||||
if ( (*p)->enabled ) {
|
||||
(*p)->update(level , header , message) ;
|
||||
}
|
||||
@ -81,7 +81,7 @@ int Trick::MessagePublisher::publish(int level , std::string message) {
|
||||
|
||||
Trick::MessageSubscriber * Trick::MessagePublisher::getSubscriber( std::string sub_name ) {
|
||||
std::list<Trick::MessageSubscriber *>::iterator lit ;
|
||||
for ( lit = subscribers.begin() ; lit != subscribers.end() ; lit++ ) {
|
||||
for ( lit = subscribers.begin() ; lit != subscribers.end() ; ++lit ) {
|
||||
if ( ! (*lit)->name.compare(sub_name) ) {
|
||||
return *lit ;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ int Trick::RtiExec::Exec () {
|
||||
// use trylock so we don't block if the mutex is in use.
|
||||
if ( pthread_mutex_trylock(&list_mutex) == 0 ) {
|
||||
std::vector < RtiList * >::iterator rlit ;
|
||||
for ( rlit = fire_list.begin() ; rlit != fire_list.end() ; rlit++ ) {
|
||||
for ( rlit = fire_list.begin() ; rlit != fire_list.end() ; ++rlit ) {
|
||||
(*rlit)->execute(debug) ;
|
||||
delete (*rlit) ;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
void Trick::RtiList::execute( bool debug ) {
|
||||
std::vector<RtiEventBase * >::iterator rebit ;
|
||||
for ( rebit = event_list.begin() ; rebit != event_list.end() ; rebit++ ) {
|
||||
for ( rebit = event_list.begin() ; rebit != event_list.end() ; ++rebit ) {
|
||||
if ( debug ) {
|
||||
message_publish(MSG_DEBUG, "Executing RTI: %s = %s\n",
|
||||
(*rebit)->ref->reference , (*rebit)->print_val().c_str() );
|
||||
@ -20,7 +20,7 @@ void Trick::RtiList::execute( bool debug ) {
|
||||
|
||||
void Trick::RtiList::print_list() {
|
||||
std::vector<RtiEventBase * >::iterator rebit ;
|
||||
for ( rebit = event_list.begin() ; rebit != event_list.end() ; rebit++ ) {
|
||||
for ( rebit = event_list.begin() ; rebit != event_list.end() ; ++rebit ) {
|
||||
(*rebit)->print_rti() ;
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ int Trick::RtiStager::List () {
|
||||
int Trick::RtiStager::SetDebug( bool on_off ) {
|
||||
debug = on_off ;
|
||||
std::vector < RtiExec * >::iterator reit ;
|
||||
for ( reit = executors.begin() ; reit != executors.end() ; reit++ ) {
|
||||
for ( reit = executors.begin() ; reit != executors.end() ; ++reit ) {
|
||||
(*reit)->SetDebug(on_off) ;
|
||||
}
|
||||
return 0 ;
|
||||
|
@ -60,7 +60,7 @@ void Trick::AttributesMap::print_xml(std::ofstream & sie_out ) {
|
||||
std::map<std::string, ATTRIBUTES *>::iterator it ;
|
||||
int jj ;
|
||||
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) {
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
|
||||
ATTRIBUTES * attr = (*it).second ;
|
||||
std::string class_name = (*it).first;
|
||||
std::replace(class_name.begin(), class_name.end(), ':', '_');
|
||||
@ -102,7 +102,7 @@ void Trick::AttributesMap::print_json(std::ofstream & sie_out ) {
|
||||
std::map<std::string, ATTRIBUTES *>::iterator it ;
|
||||
int jj ;
|
||||
sie_out << " \"classes\": [\n" ;
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) {
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
|
||||
ATTRIBUTES * attr = (*it).second ;
|
||||
std::string class_name = (*it).first;
|
||||
std::replace(class_name.begin(), class_name.end(), ':', '_');
|
||||
|
@ -14,7 +14,7 @@ void Trick::EnumAttributesMap::print_xml(std::ofstream & sie_out ) {
|
||||
std::map<std::string, ENUM_ATTR *>::iterator it ;
|
||||
ENUM_ATTR * enum_attr ;
|
||||
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) {
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
|
||||
enum_attr = (*it).second ;
|
||||
|
||||
if ( enum_attr != NULL ) {
|
||||
@ -35,7 +35,7 @@ void Trick::EnumAttributesMap::print_json(std::ofstream & sie_out ) {
|
||||
std::map<std::string, ENUM_ATTR *>::iterator it ;
|
||||
ENUM_ATTR * enum_attr ;
|
||||
sie_out << " \"enumerations\": [\n" ;
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; it++ ) {
|
||||
for ( it = name_to_attr_map.begin() ; it != name_to_attr_map.end() ; ++it ) {
|
||||
enum_attr = (*it).second ;
|
||||
|
||||
if ( enum_attr != NULL ) {
|
||||
|
@ -62,7 +62,7 @@ void Trick::Sie::top_level_objects_print(std::ofstream & sie_out) {
|
||||
Trick::VARIABLE_MAP_ITER vit ;
|
||||
int jj ;
|
||||
|
||||
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; vit++ ) {
|
||||
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; ++vit ) {
|
||||
ALLOC_INFO * alloc_info = (*vit).second ;
|
||||
|
||||
if ( alloc_info != NULL ) {
|
||||
@ -88,7 +88,7 @@ void Trick::Sie::runtime_objects_print(std::fstream & sie_out) {
|
||||
Trick::VARIABLE_MAP_ITER vit ;
|
||||
int jj ;
|
||||
|
||||
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; vit++ ) {
|
||||
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; ++vit ) {
|
||||
ALLOC_INFO * alloc_info = (*vit).second ;
|
||||
|
||||
if ( alloc_info != NULL && alloc_info->alloced_in_memory_init == 0) {
|
||||
@ -114,7 +114,7 @@ void Trick::Sie::top_level_objects_json(std::ofstream & sie_out) {
|
||||
Trick::VARIABLE_MAP_ITER vit ;
|
||||
int jj ;
|
||||
sie_out << " \"top_level_objects\": [\n";
|
||||
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; vit++ ) {
|
||||
for ( vit = trick_MM->variable_map_begin() ; vit != trick_MM->variable_map_end() ; ++vit ) {
|
||||
ALLOC_INFO * alloc_info = (*vit).second ;
|
||||
|
||||
if ( alloc_info != NULL ) {
|
||||
|
@ -13,7 +13,7 @@ Trick::SimObject::~SimObject() {
|
||||
|
||||
int Trick::SimObject::add_tag( std::string job_tag ) {
|
||||
std::vector <Trick::JobData *>::iterator it ;
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) {
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
|
||||
(*it)->add_tag(job_tag) ;
|
||||
}
|
||||
return(0) ;
|
||||
@ -72,7 +72,7 @@ Trick::JobData * Trick::SimObject::get_job( std::string job_name, unsigned int j
|
||||
std::vector <Trick::JobData *>::iterator it ;
|
||||
|
||||
// Look for the name
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) {
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
|
||||
if ( ! (*it)->name.compare(job_name) ) {
|
||||
if ( j_instance == 1 ) {
|
||||
return *it ;
|
||||
@ -87,7 +87,7 @@ Trick::JobData * Trick::SimObject::get_job( std::string job_name, unsigned int j
|
||||
job_name = name + "." + job_name ;
|
||||
}
|
||||
// Look for the job with the sim object name prepended.
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) {
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
|
||||
if ( ! (*it)->name.compare(job_name) ) {
|
||||
if ( j_instance == 1 ) {
|
||||
return *it ;
|
||||
@ -102,7 +102,7 @@ Trick::JobData * Trick::SimObject::get_job( std::string job_name, unsigned int j
|
||||
|
||||
void Trick::SimObject::enable_all_jobs() {
|
||||
std::vector <Trick::JobData *>::iterator it ;
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) {
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
|
||||
(*it)->enable() ;
|
||||
}
|
||||
}
|
||||
@ -115,7 +115,7 @@ void Trick::SimObject::enable() {
|
||||
|
||||
void Trick::SimObject::disable_all_jobs() {
|
||||
std::vector <Trick::JobData *>::iterator it ;
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; it++ ) {
|
||||
for ( it = jobs.begin() ; it != jobs.end() ; ++it ) {
|
||||
(*it)->disable() ;
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ std::string map_trick_units_to_udunits( std::string orig_units ) {
|
||||
std::vector<std::string> tokens ;
|
||||
std::vector<std::string>::iterator it ;
|
||||
tokenize_units(orig_units, tokens, "*/^()") ;
|
||||
for( it = tokens.begin() ; it != tokens.end() ; it++ ) {
|
||||
for( it = tokens.begin() ; it != tokens.end() ; ++it ) {
|
||||
char last_char = *((*it).rbegin()) ;
|
||||
// tokens can end in powers of 2 or 3 in the old system.
|
||||
// save the power if it is the last character
|
||||
|
@ -47,7 +47,7 @@ int Trick::TestSuite::add_test_requirements(std::string test_case , std::string
|
||||
|
||||
void Trick::TestSuite::delete_test_results() {
|
||||
std::vector <Trick::TestCase *>::iterator it ;
|
||||
for ( it = test_results.begin() ; it != test_results.end() ; it++ ) {
|
||||
for ( it = test_results.begin() ; it != test_results.end() ; ++it ) {
|
||||
delete (*it) ;
|
||||
}
|
||||
test_results.clear() ;
|
||||
@ -63,7 +63,7 @@ Trick::UnitTest::UnitTest() {
|
||||
|
||||
Trick::UnitTest::~UnitTest() {
|
||||
std::map< std::string , TestSuite >::iterator it ;
|
||||
for ( it = test_suites.begin() ; it != test_suites.end() ; it++ ) {
|
||||
for ( it = test_suites.begin() ; it != test_suites.end() ; ++it ) {
|
||||
(it->second).delete_test_results() ;
|
||||
}
|
||||
}
|
||||
@ -121,7 +121,7 @@ int Trick::UnitTest::write_output() {
|
||||
unsigned int jj ;
|
||||
|
||||
if ( enabled ) {
|
||||
for ( it = test_suites.begin() ; it != test_suites.end() ; it++ ) {
|
||||
for ( it = test_suites.begin() ; it != test_suites.end() ; ++it ) {
|
||||
curr_suite = &(it->second) ;
|
||||
num_tests += curr_suite->test_results.size() ;
|
||||
num_failures += curr_suite->num_failures ;
|
||||
@ -133,7 +133,7 @@ int Trick::UnitTest::write_output() {
|
||||
out << "<testsuites tests=\"" << num_tests << "\" failures=\"" << num_failures <<
|
||||
"\" disabled=\"0\" errors=\"0\" time=\"0.0\" name=\"" << name << "\">" << std::endl ;
|
||||
|
||||
for ( it = test_suites.begin() ; it != test_suites.end() ; it++ ) {
|
||||
for ( it = test_suites.begin() ; it != test_suites.end() ; ++it ) {
|
||||
curr_suite = &(it->second) ;
|
||||
out << " <testsuite name=\"" << it->first << "\" tests=\"" << curr_suite->test_results.size() ;
|
||||
out << "\" failures=\"" << num_failures << "\" disabled=\"0\" errors=\"0\" time=\"0.0\">" << std::endl ;
|
||||
|
@ -21,7 +21,7 @@ Trick::UnitsMap::~UnitsMap() {
|
||||
|
||||
std::map<std::string, char * >::iterator pit ;
|
||||
|
||||
for ( pit = param_units.begin() ; pit != param_units.end() ; pit++ ) {
|
||||
for ( pit = param_units.begin() ; pit != param_units.end() ; ++pit ) {
|
||||
free((*pit).second) ;
|
||||
}
|
||||
param_units.clear() ;
|
||||
|
@ -29,7 +29,7 @@ std::ostream& Trick::operator<< (std::ostream& s, Trick::VariableServer& vs) {
|
||||
s << "{\"variable_server_connections\":[\n";
|
||||
int count = 0;
|
||||
int n_connections = (int)vs.var_server_threads.size();
|
||||
for ( it = vs.var_server_threads.begin() ; it != vs.var_server_threads.end() ; it++ ) {
|
||||
for ( it = vs.var_server_threads.begin() ; it != vs.var_server_threads.end() ; ++it ) {
|
||||
s << "{\n";
|
||||
s << *(*it).second;
|
||||
s << "}";
|
||||
|
@ -4,7 +4,7 @@
|
||||
int Trick::VariableServer::copy_and_write_freeze() {
|
||||
|
||||
pthread_mutex_lock(&map_mutex) ;
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) {
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
|
||||
(*it).second->copy_and_write_freeze(exec_get_freeze_frame_count()) ;
|
||||
}
|
||||
pthread_mutex_unlock(&map_mutex) ;
|
||||
|
@ -10,7 +10,7 @@ int Trick::VariableServer::copy_and_write_freeze_scheduled() {
|
||||
long long next_call_tics = TRICK_MAX_LONG_LONG ;
|
||||
|
||||
pthread_mutex_lock(&map_mutex) ;
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) {
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
|
||||
VariableServerSession * session = (*it).second ;
|
||||
session->copy_and_write_freeze_scheduled(copy_and_write_freeze_job->next_tics) ;
|
||||
if ( session->get_freeze_next_tics() < next_call_tics ) {
|
||||
|
@ -10,7 +10,7 @@ int Trick::VariableServer::copy_and_write_scheduled() {
|
||||
long long next_call_tics = TRICK_MAX_LONG_LONG;
|
||||
|
||||
pthread_mutex_lock(&map_mutex) ;
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) {
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
|
||||
VariableServerSession * session = (*it).second ;
|
||||
session->copy_and_write_scheduled(copy_data_job->next_tics) ;
|
||||
if ( session->get_next_tics() < next_call_tics ) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
int Trick::VariableServer::copy_and_write_top() {
|
||||
|
||||
pthread_mutex_lock(&map_mutex) ;
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) {
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
|
||||
(*it).second->copy_and_write_top(exec_get_frame_count()) ;
|
||||
}
|
||||
pthread_mutex_unlock(&map_mutex) ;
|
||||
|
@ -12,7 +12,7 @@ int Trick::VariableServer::freeze_init() {
|
||||
long long next_call_tics = TRICK_MAX_LONG_LONG ;
|
||||
|
||||
pthread_mutex_lock(&map_mutex) ;
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) {
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
|
||||
VariableServerSession * session = (*it).second ;
|
||||
session->freeze_init() ;
|
||||
if ( session->get_freeze_next_tics() < next_call_tics ) {
|
||||
|
@ -9,7 +9,7 @@ int Trick::VariableServer::get_next_freeze_call_time() {
|
||||
long long next_call_tics = TRICK_MAX_LONG_LONG;
|
||||
|
||||
pthread_mutex_lock(&map_mutex) ;
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) {
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
|
||||
VariableServerSession * session = (*it).second ;
|
||||
if ( session->get_freeze_next_tics() < next_call_tics ) {
|
||||
next_call_tics = session->get_freeze_next_tics() ;
|
||||
|
@ -9,7 +9,7 @@ int Trick::VariableServer::get_next_sync_call_time() {
|
||||
long long next_call_tics = TRICK_MAX_LONG_LONG ;
|
||||
|
||||
pthread_mutex_lock(&map_mutex) ;
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; it++ ) {
|
||||
for ( auto it = var_server_sessions.begin() ; it != var_server_sessions.end() ; ++it ) {
|
||||
VariableServerSession * session = (*it).second ;
|
||||
if ( session->get_next_tics() < next_call_tics ) {
|
||||
next_call_tics = session->get_next_tics() ;
|
||||
|
@ -27,7 +27,7 @@ Trick::PrimitiveAttributesMap::PrimitiveAttributesMap() {
|
||||
|
||||
Trick::PrimitiveAttributesMap::~PrimitiveAttributesMap() {
|
||||
std::map<std::string, ATTRIBUTES * >::iterator pit ;
|
||||
for ( pit = param_attr.begin() ; pit != param_attr.end() ; pit++ ) {
|
||||
for ( pit = param_attr.begin() ; pit != param_attr.end() ; ++pit ) {
|
||||
delete(pit->second) ;
|
||||
}
|
||||
param_attr.clear() ;
|
||||
|
@ -60,7 +60,7 @@ void VariableServerSession::sendMessage() {
|
||||
ss << " \"time\" : " << std::setprecision(16) << stageTime << ",\n";
|
||||
ss << " \"values\" : [\n";
|
||||
|
||||
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) {
|
||||
for (it = sessionVariables.begin(); it != sessionVariables.end(); ++it ) {
|
||||
if (it != sessionVariables.begin()) ss << ",\n";
|
||||
(*it)->writeValue(ss);
|
||||
}
|
||||
@ -83,7 +83,7 @@ int VariableServerSession::handleMessage(const std::string& client_msg) {
|
||||
std::string pycode;
|
||||
int period;
|
||||
|
||||
for (it = members.begin(); it != members.end(); it++ ) {
|
||||
for (it = members.begin(); it != members.end(); ++it ) {
|
||||
if (strcmp((*it)->key, "cmd") == 0) {
|
||||
cmd = (*it)->valText;
|
||||
} else if (strcmp((*it)->key, "var_name") == 0) {
|
||||
@ -172,7 +172,7 @@ void VariableServerSession::addVariable(char* vname){
|
||||
void VariableServerSession::stageValues() {
|
||||
stageTime = (double)(exec_get_time_tics()) / exec_get_time_tic_value();
|
||||
std::vector<VariableServerVariable*>::iterator it;
|
||||
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) {
|
||||
for (it = sessionVariables.begin(); it != sessionVariables.end(); ++it ) {
|
||||
(*it)->stageValue();
|
||||
}
|
||||
dataStaged = true;
|
||||
@ -251,7 +251,7 @@ int VariableServerSession::sendUnitsMessage(const char* vname) {
|
||||
std::vector<VariableServerVariable*>::iterator it;
|
||||
std::stringstream ss;
|
||||
ss << "{ \"msg_type\": \"units\", \"var_name\": \"" << vname << "\", \"data\": \"";
|
||||
for (it = sessionVariables.begin(); it != sessionVariables.end(); it++ ) {
|
||||
for (it = sessionVariables.begin(); it != sessionVariables.end(); ++it ) {
|
||||
if(!strcmp((*it)->getName(), vname)) {
|
||||
ss << (
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user