source: XMLIO_V2/dev/dev_rv/src4/xmlio/attribute/attribute_impl.hpp @ 257

Last change on this file since 257 was 257, checked in by hozdoba, 13 years ago

Ajout de classes pour la version 4

File size: 1.3 KB
Line 
1/* ************************************************************************** *
2 *      Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
3 * ************************************************************************** */
4
5#ifndef __ATTRIBUTE_IMPL_HPP__
6#define __ATTRIBUTE_IMPL_HPP__
7
8/**
9 * \file    attribute_impl.hpp
10 * \brief   Gestion des attributs des objets dans la hierarchie de la bibliothÚque (implémentation template).
11 * \author  Hervé Ozdoba
12 * \version 0.4
13 * \date    1er Juin 2011
14 */
15
16// /////////////////////////////// Définitions ////////////////////////////// //
17
18namespace xmlioserver {
19namespace tree {
20 
21   // ------------------------------- Accesseurs -------------------------------
22   
23   template <typename T> T CAttribute::getValue(void) const
24   { 
25      return (boost::any_cast<T>(this->value)); 
26   }
27   
28   // ------------------------------- Mutateurs --------------------------------
29   
30   template <typename T> void CAttribute::setValue(const T & value)
31   { 
32      this->value = value; 
33   }
34   
35   // --------------------------- Tests sur l'objet ----------------------------
36   
37   template<typename T> bool CAttribute::isType(void)
38   { 
39      return (this->value.type() == typeid(T)); 
40   }
41 
42 
43} // namespace tree
44} // namespace xmlioserver
45
46#endif // __ATTRIBUTE_IMPL_HPP__
Note: See TracBrowser for help on using the repository browser.