struct Properties
{
int mint;
int maxt;
int medt;
Properties( int a, b, c ) : mint(a), maxt(b), medt(c) {}
};
typedef std::map < std::string, Properties > ProcessMap;
bool is_there( const ProcessMap& pmap, const std::string& pname )
{ return pmap.find(pname) != pmap.end() ; }
void insert( ProcessMap& pmap, const std::string& pname,
int mint, int maxt, int medt )
{ pmap[pname] = Properties(mint,maxt,medt) ; }
void incr_times( ProcessMap& pmap, const std::string& pname )
{
Properties& p = pmap[pname] ;
++p.mint ;
// etc
}
Last edited by vijayan121; Nov 20th, 2007 at 10:06 am.
Reputation Points: 1159
Solved Threads: 285
Posting Virtuoso
Offline 1,606 posts
since Dec 2006