-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecutable_map.h
More file actions
31 lines (26 loc) · 1.45 KB
/
executable_map.h
File metadata and controls
31 lines (26 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2005-2018 Samuel Newbold
// Executable_map must be able to lookup .argfunction, which is
// part of an Argm. Thus Argm must be the key_type so as to specify which
// .argfunction is intended. Argm are not stored in the map, so
// value_type is not std::pair<key_type, mapped_type>
class Executable_map : private std::map<std::string, Base_executable*> {
typedef std::map<std::string, Base_executable*> Base;
bool in_autofunction;
void not_found(Argm& argm, Error_list& exceptions); // doesn't catch unwind
public:
typedef Base::const_iterator const_iterator;
typedef Base::iterator iterator;
Executable_map(void);
const_iterator begin(void) const {return Base::begin();};
const_iterator end(void) const {return Base::end();};
size_type erase (const std::string& key);
Base_executable* find_second(const Argm& key);
void run(Argm& argm, Error_list& exceptions); // doesn't catch unwind
bool run_condition(Argm& argm, Error_list& exceptions); // only .false
void base_run(Argm& argm, Error_list& exceptions); // catches unwind
void run_handling_exceptions(Argm& argm, Error_list& exceptions); // ditto
void unused_var_check_at_exit(void); // catches unwind
bool run_if_exists(const std::string& key, Argm& argm); // catches unwind
// insert executable if not present, replace if executable already exists
void set(Named_executable* target); };
extern Executable_map executable_map;