Removed "using namespace std" statements from header files in EO -- "std::" identifier were added where necessary.

This commit is contained in:
okoenig 2003-02-27 19:28:07 +00:00
commit 86fa476c67
263 changed files with 2009 additions and 1976 deletions

View file

@ -38,7 +38,7 @@
// In the near future ... Enabling different kinds of EO to send/receive ..
template <class EOT> class eoListener : public vector <eoLocalListener <EOT> > {
template <class EOT> class eoListener : public std::vector <eoLocalListener <EOT> > {
public :
@ -91,11 +91,11 @@ public :
}
/**
To broadcast the string identifier of the local process to the
To broadcast the std::string identifier of the local process to the
whole neighbouring ...
*/
void publish (string label) {
void publish (std::string label) {
eoPublishMessTo <EOT> mess (label) ;
for (int i = 0 ; i < size () ; i ++)
@ -123,7 +123,7 @@ public :
} while (! b) ;
}
void destroy (string label) {
void destroy (std::string label) {
eoKillMessTo <EOT> mess ;
for (int i = 0 ; i < len ; i ++) {

View file

@ -50,7 +50,7 @@ template <class EOT> class eoEOSendMessFrom ;
template <class EOT> class eoPublishMessFrom ;
template <class EOT> class eoKillMessFrom ;
template <class EOT> class eoLocalListener : public queue <eoPop <EOT> > {
template <class EOT> class eoLocalListener : public std::queue <eoPop <EOT> > {
public :
@ -125,7 +125,7 @@ public :
String identifier of this algo/agent ?
*/
string & label () {
std::string & label () {
return name_id ;
}
@ -142,18 +142,18 @@ public :
void destroy () {
cout << "Agent [" << name_id << "] stopped ..." << endl ;
std::cout << "Agent [" << name_id << "] stopped ..." << std::endl ;
MPI :: Finalize () ;
exit (0) ;
}
char host_name [255] ; // Host string identifier
char host_name [255] ; // Host std::string identifier
private :
MPI :: Comm * comm ; // MPI Communicator
string name_id ; // String id.
std::string name_id ; // String id.
int num_id ; // MPI id.
bool req_EO ;

View file

@ -40,11 +40,11 @@ template <class EOT> class eoMessTo {
public :
/**
Constructor. A string identifier, being defined in subclasses
Constructor. A std::string identifier, being defined in subclasses
is given for any kind of messages.
*/
eoMessTo (string _label) :
eoMessTo (std::string _label) :
label (_label),
comm (MPI :: COMM_WORLD) {
@ -64,7 +64,7 @@ protected :
MPI :: Comm & comm ; // MPI Communicator
string label ; // String identifier of the message
std::string label ; // String identifier of the message
} ;

View file

@ -57,7 +57,7 @@ public :
void operator () () {
loc_listen.push (pop) ;
// cout << "Reception de " << pop.size () << "individus " << endl ;
// std::cout << "Reception de " << pop.size () << "individus " << std::endl ;
}
private :

View file

@ -34,7 +34,7 @@ template <class EOT> class eoLocalListener ;
message to be then received ...
*/
template <class EOT> class eoHeaderMessFrom : public string {
template <class EOT> class eoHeaderMessFrom : public std::string {
public :

View file

@ -58,7 +58,7 @@ public :
private :
string label ; // String identifier ...
std::string label ; // String identifier ...
} ;

View file

@ -54,7 +54,7 @@ public :
eoMessTo <EOT> :: operator () (loc_listen) ;
ostrstream f ;
std::ostrstream f ;
pop.printOn (f) ;
comm.Send (f.str (), f.pcount (), MPI :: CHAR, loc_listen.number (), 0) ;
loc_listen.need_immigration () = false ;

View file

@ -35,18 +35,18 @@ template <class EOT> class eoLocalListener ;
message to be then sent ...
*/
template <class EOT> class eoHeaderMessTo : public string {
template <class EOT> class eoHeaderMessTo : public std::string {
public :
/**
Constructor.
The string identifiant id given in parameter.
The std::string identifiant id given in parameter.
*/
eoHeaderMessTo (string label) :
eoHeaderMessTo (std::string label) :
string (label),
std::string (label),
comm (MPI :: COMM_WORLD) {
}

View file

@ -22,7 +22,7 @@
*/
/**
To let know from distributed algos the string identifier
To let know from distributed algos the std::string identifier
of the home process ...
*/
@ -42,7 +42,7 @@ public :
Constructor
*/
eoPublishMessTo (string & _label
eoPublishMessTo (std::string & _label
) :
eoMessTo <EOT> ("eoPublishMessTo"),
label (_label) {
@ -57,7 +57,7 @@ public :
private :
string label ; // String identifier to send ...
std::string label ; // String identifier to send ...
} ;

View file

@ -43,7 +43,7 @@ public :
Constructor
*/
eoPopAgent (string _label,
eoPopAgent (std::string _label,
eoListener <EOT> & _listen,
eoPopAlgo <EOT> & _algo
) :
@ -68,7 +68,7 @@ public :
while (! listen [i].empty ()) {
eoPop <EOT> & pop = listen [i].front () ;
cout << "Agent [" << label << "] on " << listen.here ().host_name << " : Receiving " << pop.size () << " individuals ..." << endl ;
std::cout << "Agent [" << label << "] on " << listen.here ().host_name << " : Receiving " << pop.size () << " individuals ..." << std::endl ;
algo (pop) ;
eoEOSendMessTo <EOT> mess (pop) ;
mess (listen [i]) ; // Coming back ...
@ -80,7 +80,7 @@ public :
private :
string label ; // string identifier
std::string label ; // std::string identifier
eoListener <EOT> & listen ; // EO's listener
eoPopAlgo <EOT> & algo ; // Local supplied algo

View file

@ -43,7 +43,7 @@ public :
Constructor
*/
eoSolAgent (string _label,
eoSolAgent (std::string _label,
eoListener <EOT> & _listen,
eoSolAlgo <EOT> & _algo
) :
@ -68,7 +68,7 @@ public :
while (! listen [i].empty ()) {
EOT & sol = listen [i].front () ;
cout << "Agent [" << label << "] on " << listen.here ().host_name << " : Receiving one individual ..." << endl ;
std::cout << "Agent [" << label << "] on " << listen.here ().host_name << " : Receiving one individual ..." << std::endl ;
algo (sol) ;
eoPop <EOT> pop ;
pop.push_back (sol) ;
@ -82,7 +82,7 @@ public :
private :
string label ; // string identifier
std::string label ; // std::string identifier
eoListener <EOT> & listen ; // EO's listener
eoSolAlgo <EOT> & algo ; // Local supplied algo

View file

@ -44,7 +44,7 @@ public :
eoDistEvalEasyEA (eoListener <EOT> & _listen,
eoEasyEA <EOT> & _ea,
string _label
std::string _label
) :
pop_eval (eoDistPopEvalFunc <EOT> (_listen, _label, _ea.eval)),
eoEasyEA <EOT> (_ea.continuator,

View file

@ -36,7 +36,7 @@ public :
*/
eoDistPopEvalFunc (eoListener <EOT> & _listen,
string & _label,
std::string & _label,
eoEvalFunc <EOT> & _eval
) :
listen (_listen),
@ -58,8 +58,8 @@ public :
}
if (num_eval == 0) {
cout << "No [" << label << "] available ..." << endl ;
cout << "Waiting for a few seconds ..." << endl ;
std::cout << "No [" << label << "] available ..." << std::endl ;
std::cout << "Waiting for a few seconds ..." << std::endl ;
sleep (2) ;
}
} while (num_eval == 0) ;
@ -120,7 +120,7 @@ public :
private :
eoListener <EOT> & listen ;
string label ; // String identifier of evaluators
std::string label ; // String identifier of evaluators
eoEvalFunc <EOT> & eval ;
} ;

View file

@ -44,7 +44,7 @@ public :
Constructor
*/
eoEvaluator (string _label,
eoEvaluator (std::string _label,
eoListener <EOT> & _listen,
eoEvalFunc <EOT> & _eval
) :

View file

@ -44,7 +44,7 @@ public :
*/
eoConnectivity (eoListener <EOT> & _listen,
vector <string> & _sel_neigh
std::vector <std::string> & _sel_neigh
) :
listen (_listen),
sel_neigh (_sel_neigh) {
@ -56,22 +56,22 @@ public :
immigrants from ...
*/
virtual vector <eoLocalListener <EOT> *> from () = 0 ;
virtual std::vector <eoLocalListener <EOT> *> from () = 0 ;
/**
Computes the subset of neighbours to send
emigrants to ...
*/
virtual vector <eoLocalListener <EOT> *> to () = 0 ;
virtual std::vector <eoLocalListener <EOT> *> to () = 0 ;
protected :
eoListener <EOT> & listen ;
vector <string> sel_neigh ;
std::vector <std::string> sel_neigh ;
bool selected (string & id) {
bool selected (std::string & id) {
for (int i = 0 ; i < sel_neigh.size () ; i ++)
if (sel_neigh [i] == id)

View file

@ -50,7 +50,7 @@ public :
Constructor
*/
eoIslandsEasyEA (string _id,
eoIslandsEasyEA (std::string _id,
eoListener <EOT> & _listen,
eoConnectivity <EOT> & _conn,
eoEasyEA <EOT> & _ea,
@ -87,7 +87,7 @@ private :
// Internal components
string id ; // String identifiant of this algorithm
std::string id ; // String identifiant of this algorithm
eoListener <EOT> & listen ; // The neighbouring of concurrent algos
eoConnectivity <EOT> & conn ; // Communication topology
eoCheckPoint <EOT> chkp ;

View file

@ -85,14 +85,14 @@ public :
listen.update () ;
// listen.display () ;
vector <eoLocalListener <EOT> *> src = conn.from (), dest = conn.to () ;
std::vector <eoLocalListener <EOT> *> src = conn.from (), dest = conn.to () ;
// Any coming immigrants ?
for (int i = 0 ; i < src.size () ; i ++) {
src [i] -> update () ;
while (! src [i] -> empty ()) {
replace (* pop, src [i] -> front ()) ;
cout << "[" << listen.here ().host_name << "] Arrival of " << src [i] -> front ().size () << " individuals ..." << endl ;
std::cout << "[" << listen.here ().host_name << "] Arrival of " << src [i] -> front ().size () << " individuals ..." << std::endl ;
src [i] -> pop () ;
}
}

View file

@ -39,15 +39,15 @@ public :
*/
eoFullConnectivity (eoListener <EOT> & _listen,
vector <string> & _sel_neigh
std::vector <std::string> & _sel_neigh
) : eoConnectivity <EOT> (_listen, _sel_neigh) {
}
virtual vector <eoLocalListener <EOT> *> from () {
virtual std::vector <eoLocalListener <EOT> *> from () {
listen.update () ;
vector <eoLocalListener <EOT> *> v ;
std::vector <eoLocalListener <EOT> *> v ;
for (int i = 0 ; i < listen.size () ; i ++)
if (i != listen.here ().number () && selected (listen [i].label ()))
@ -56,11 +56,11 @@ public :
return v ;
}
virtual vector <eoLocalListener <EOT> *> to () {
virtual std::vector <eoLocalListener <EOT> *> to () {
listen.update () ;
vector <eoLocalListener <EOT> *> v ;
std::vector <eoLocalListener <EOT> *> v ;
for (int i = 0 ; i < listen.size () ; i ++)
if (i != listen.here ().number () && selected (listen [i].label ()))

View file

@ -27,7 +27,7 @@
#include <paradisEO/island/eoConnectivity.h>
/**
Each algorithm has a single pair of entering and outgoing
Each algorithm has a single std::pair of entering and outgoing
neighbours, so that the unit constitutes a circular topology.
*/
@ -40,15 +40,15 @@ public :
*/
eoRingConnectivity (eoListener <EOT> & _listen,
vector <string> & _sel_neigh
std::vector <std::string> & _sel_neigh
) : eoConnectivity <EOT> (_listen, _sel_neigh) {
}
virtual vector <eoLocalListener <EOT> *> from () {
virtual std::vector <eoLocalListener <EOT> *> from () {
listen.update () ;
vector <eoLocalListener <EOT> *> v ;
std::vector <eoLocalListener <EOT> *> v ;
int i, k = listen.size () ;
for (i = 0 ; i < k ; i ++) {
@ -69,11 +69,11 @@ public :
*/
virtual vector <eoLocalListener <EOT> *> to () {
virtual std::vector <eoLocalListener <EOT> *> to () {
listen.update () ;
vector <eoLocalListener <EOT> *> v ;
std::vector <eoLocalListener <EOT> *> v ;
int i, k = listen.size () ;
for (i = 0 ; i < k ; i ++)