Main Page ? Class Hierarchy ? Compound List ? File List ? Compound Members ? File Members ?

PatternCache Class Reference

Collaboration diagram for PatternCache:

[legend]
List of all members.

Static Public Methods

PatternCache &? instance ()
bool? update (Use *c, Use *t)
Use::UsePtrVector &? get_list ()

Private Methods

? PatternCache ()
bool? do_update (Use *c, Use *t)

Private Attributes

Use *? current
cmt_string? current_name
Use *? target
cmt_string? target_name
Use::UsePtrVector? list

Constructor & Destructor Documentation

PatternCache::PatternCache (? ? )? [inline, private]
?

Definition at line 632 of file cmt_pattern.cxx.

References current, current_name, target, and target_name.

00632                   : current(0), target(0)
00633   {
00634     current_name = "";
00635     target_name = "";
00636   }

Member Function Documentation

bool PatternCache::do_update (? Use *? ? c,
Use *? ? t
)? [inline, private]
?

Definition at line 638 of file cmt_pattern.cxx.

References cmt_vector< Use * >::clear(), current, current_name, Use::get_package_name(), Use::get_paths(), CmtSystem::getenv(), list, cmt_vector< Use * >::push_back(), target, and target_name.

Referenced by update().

00639   {
00640     cmt_string c_name = c->get_package_name ();
00641     cmt_string t_name = t->get_package_name ();
00642 
00643     if ((current_name != c_name) || (target_name != t_name))
00644       {
00645         if (CmtSystem::getenv ("TESTCACHE") != "")
00646           {
00647             cout << "update cache " << c->get_package_name () << "(" << c << ") " << t->get_package_name () << "(" << t << ")" << endl;
00648           }
00649         
00650         current = c;
00651         current_name = c_name;
00652 
00653         target = t;
00654         target_name = t_name;
00655 
00656         list.clear ();
00657           
00658         if (current != target)
00659           {
00660             if (!current->get_paths (target, list)) return (false);
00661           }
00662         else
00663           {
00664             list.push_back (current);
00665           }
00666       }
00667     else
00668       {
00669         if (CmtSystem::getenv ("TESTCACHE") != "")
00670           {
00671             cout << "keep cache" << endl;
00672           }
00673       }
00674     return (true);
00675   }

Use::UsePtrVector& PatternCache::get_list (? ? )? [inline, static]
?

Definition at line 623 of file cmt_pattern.cxx.

References instance(), and list.

Referenced by Pattern::apply().

00624   {
00625     static PatternCache& me = instance ();
00626 
00627     return (me.list);
00628   }

PatternCache& PatternCache::instance (? ? )? [inline, static]
?

Definition at line 609 of file cmt_pattern.cxx.

Referenced by get_list(), and update().

00610   {
00611     static PatternCache me;
00612 
00613     return (me);
00614   }

bool PatternCache::update (? Use *? ? c,
Use *? ? t
)? [inline, static]
?

Definition at line 616 of file cmt_pattern.cxx.

References do_update(), and instance().

Referenced by Pattern::apply().

00617   {
00618     static PatternCache& me = instance ();
00619 
00620     return (me.do_update (c, t));
00621   }

Member Data Documentation

Use* PatternCache::current [private]
?

Definition at line 677 of file cmt_pattern.cxx.

Referenced by do_update(), and PatternCache().

cmt_string PatternCache::current_name [private]
?

Definition at line 678 of file cmt_pattern.cxx.

Referenced by do_update(), and PatternCache().

Use::UsePtrVector PatternCache::list [private]
?

Definition at line 681 of file cmt_pattern.cxx.

Referenced by do_update(), and get_list().

Use* PatternCache::target [private]
?

Definition at line 679 of file cmt_pattern.cxx.

Referenced by do_update(), and PatternCache().

cmt_string PatternCache::target_name [private]
?

Definition at line 680 of file cmt_pattern.cxx.

Referenced by do_update(), and PatternCache().


The documentation for this class was generated from the following file:
Generated on Wed Sep 1 11:00:49 2004 for CMT by 1.2.18