Mercurial > octave-nkf
comparison src/load-path.h @ 9010:f914834836e7
Partial implementation of derived classes using the old form with "@" files.
author | rtshort@smoketree.phaselocked.com |
---|---|
date | Tue, 24 Mar 2009 11:29:53 -0400 |
parents | d865363208d6 |
children | 95445f9f5976 |
comparison
equal
deleted
inserted
replaced
9009:da58ec8f62e8 | 9010:f914834836e7 |
---|---|
35 OCTINTERP_API | 35 OCTINTERP_API |
36 load_path | 36 load_path |
37 { | 37 { |
38 protected: | 38 protected: |
39 | 39 |
40 load_path (void) : dir_info_list (), fcn_map (), method_map () { } | 40 load_path (void) |
41 : dir_info_list (), fcn_map (), method_map (), parent_map () { } | |
41 | 42 |
42 public: | 43 public: |
43 | 44 |
44 typedef void (*hook_fcn_ptr) (const std::string& dir); | 45 typedef void (*hook_fcn_ptr) (const std::string& dir); |
45 | 46 |
224 } | 225 } |
225 | 226 |
226 static std::string system_path (void) | 227 static std::string system_path (void) |
227 { | 228 { |
228 return instance_ok () ? instance->do_system_path () : std::string (); | 229 return instance_ok () ? instance->do_system_path () : std::string (); |
230 } | |
231 | |
232 static void add_to_parent_map (const std::string& classname, | |
233 const std::list<std::string>& parent_list) | |
234 { | |
235 if (instance_ok ()) | |
236 instance->do_add_to_parent_map (classname, parent_list); | |
229 } | 237 } |
230 | 238 |
231 private: | 239 private: |
232 | 240 |
233 static const int M_FILE = 1; | 241 static const int M_FILE = 1; |
384 // <CLASS_NAME, <FCN_NAME, FILE_INFO_LIST>> | 392 // <CLASS_NAME, <FCN_NAME, FILE_INFO_LIST>> |
385 typedef std::map<std::string, fcn_map_type> method_map_type; | 393 typedef std::map<std::string, fcn_map_type> method_map_type; |
386 | 394 |
387 typedef method_map_type::const_iterator const_method_map_iterator; | 395 typedef method_map_type::const_iterator const_method_map_iterator; |
388 typedef method_map_type::iterator method_map_iterator; | 396 typedef method_map_type::iterator method_map_iterator; |
397 | |
398 // <CLASS_NAME, PARENT_LIST>> | |
399 typedef std::map<std::string, std::list<std::string> > parent_map_type; | |
400 | |
401 typedef parent_map_type::const_iterator const_parent_map_iterator; | |
402 typedef parent_map_type::iterator parent_map_iterator; | |
389 | 403 |
390 mutable dir_info_list_type dir_info_list; | 404 mutable dir_info_list_type dir_info_list; |
391 | 405 |
392 mutable fcn_map_type fcn_map; | 406 mutable fcn_map_type fcn_map; |
393 | 407 |
394 mutable private_fcn_map_type private_fcn_map; | 408 mutable private_fcn_map_type private_fcn_map; |
395 | 409 |
396 mutable method_map_type method_map; | 410 mutable method_map_type method_map; |
411 | |
412 mutable parent_map_type parent_map; | |
397 | 413 |
398 static load_path *instance; | 414 static load_path *instance; |
399 | 415 |
400 static hook_fcn_ptr add_hook; | 416 static hook_fcn_ptr add_hook; |
401 | 417 |
490 void do_display (std::ostream& os) const; | 506 void do_display (std::ostream& os) const; |
491 | 507 |
492 std::string do_system_path (void) const { return sys_path; } | 508 std::string do_system_path (void) const { return sys_path; } |
493 | 509 |
494 std::string do_get_command_line_path (void) const { return command_line_path; } | 510 std::string do_get_command_line_path (void) const { return command_line_path; } |
511 | |
512 void do_add_to_parent_map (const std::string& classname, | |
513 const std::list<std::string>& parent_list) const; | |
495 | 514 |
496 void add_to_fcn_map (const dir_info& di, bool at_end) const; | 515 void add_to_fcn_map (const dir_info& di, bool at_end) const; |
497 | 516 |
498 void add_to_private_fcn_map (const dir_info& di) const; | 517 void add_to_private_fcn_map (const dir_info& di) const; |
499 | 518 |