X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FTuto_NameSpaces%2Fsrc%2Fcpp%2Fcore%2Fnamespace%2F02_classes%2FuseNameSpaceObject.cpp;fp=WCudaMSE%2FTuto_NameSpaces%2Fsrc%2Fcpp%2Fcore%2Fnamespace%2F02_classes%2FuseNameSpaceObject.cpp;h=cacfc8e2243810c0897b34dc4ee7173606fa663c;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Tuto_NameSpaces/src/cpp/core/namespace/02_classes/useNameSpaceObject.cpp b/WCudaMSE/Tuto_NameSpaces/src/cpp/core/namespace/02_classes/useNameSpaceObject.cpp new file mode 100755 index 0000000..cacfc8e --- /dev/null +++ b/WCudaMSE/Tuto_NameSpaces/src/cpp/core/namespace/02_classes/useNameSpaceObject.cpp @@ -0,0 +1,65 @@ +#include "PersonnageBD.h" +#include "PersonnageFilm.h" +#include "PersonnageTele.h" + +#include +using std::cout; +using std::endl; + + + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + + + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/** + * Dans les trois namespace: + * bd + * film + * tele + * + * La classe est la meme, ie Personnage! + * Le namespace permet d'éviter des conflits de nom. + * + * Attention: + * Contrairement à java, le nom des fichiers (.cpp, .h) ne peut lui être trois fois le meme. + * Il doit etre obligatoirement etre different: + * + * PersonnageBD.h PersonnageBD.cpp + * PersonnageFilm PersonnageFilm + * PersonnageTele PersonnageTele + * + */ +void useNameSpaceObject() + { + cout<< endl<<"[Using Namespaces with Object] :"<