synaps/mpol/AllVariables.h

00001 /*******************************************************************
00002  *   This file is part of the source code of the SYNAPS kernel.
00003  *   Author(s): B. Mourrain, GALAAD, INRIA
00004  *   $Id: $
00005  ********************************************************************/
00006 #ifndef synaps_mpol_AllVariables_H
00007 #define synaps_mpol_AllVariables_H
00008 //===================================================================
00009 #include <synaps/init.h>
00010 #include <string>
00011 #include <sstream>
00012 //===================================================================
00013 __BEGIN_NAMESPACE_SYNAPS
00014 //===================================================================
00015 template<char v>
00016 struct AllVariables 
00017 {
00018   AllVariables(){}
00019   std::string  operator[](int i) const
00020   {
00021     int sz=1,m=1;
00022     while(m<i) {m*=10; sz++;}
00023     char str[sz+1];
00024     sprintf(str,"d%d",i);
00025     return std::string(str);
00026   }
00027 };
00028 __END_NAMESPACE_SYNAPS
00029 #endif // synaps_mpol_AllVariables_h

SYNAPS DOCUMENTATION
logo