MCPcopy Create free account
hub / github.com/devosoft/avida / cFunctionIterator

Class cFunctionIterator

avida-core/source/script/cSymbolTable.h:105–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104 // -------- Externally Visible Type Declarations --------
105 class cFunctionIterator
106 {
107 friend class cSymbolTable;
108
109 private:
110 cSymbolTable* m_symtbl;
111 int m_scope;
112 int m_idx;
113
114 cFunctionIterator(cSymbolTable* symtbl)
115 : m_symtbl(symtbl), m_scope(symtbl->GetScope()), m_idx(symtbl->GetNumFunctions()) { ; }
116
117 public:
118 bool Next()
119 {
120 for (m_idx--; m_idx >= 0; m_idx--)
121 if (m_symtbl->GetFunctionScope(m_idx) == m_scope && m_symtbl->IsFunctionActive(m_idx)) return true;
122
123 return false;
124 }
125
126 inline bool HasCode() const { return m_symtbl->GetFunctionDefinition(m_idx); }
127 inline const cString& GetName() const { return m_symtbl->GetFunctionName(m_idx); }
128 };
129
130
131 // -------- Externally Visible Type Dependent Methods --------

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected