os/ossrv/stdcpp/tsrc/Stdcpp_test/stdcxx/include/any.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/stdcpp/tsrc/Stdcpp_test/stdcxx/include/any.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,135 @@
     1.4 +/***************************************************************************
     1.5 + *
     1.6 + * any.h - definition of the rw_any_t class
     1.7 + *
     1.8 + * $Id: any.h 290028 2005-09-19 00:25:26Z sebor $
     1.9 + *
    1.10 + ***************************************************************************
    1.11 + *
    1.12 + * Copyright (c) 1994-2005 Quovadx,  Inc., acting through its  Rogue Wave
    1.13 + * Software division. Licensed under the Apache License, Version 2.0 (the
    1.14 + * "License");  you may  not use this file except  in compliance with the
    1.15 + * License.    You    may   obtain   a   copy   of    the   License    at
    1.16 + * http://www.apache.org/licenses/LICENSE-2.0.    Unless   required    by
    1.17 + * applicable law  or agreed to  in writing,  software  distributed under
    1.18 + * the License is distributed on an "AS IS" BASIS,  WITHOUT WARRANTIES OR
    1.19 + * CONDITIONS OF  ANY KIND, either  express or implied.  See  the License
    1.20 + * for the specific language governing permissions  and limitations under
    1.21 + * the License.
    1.22 + * 
    1.23 + **************************************************************************/
    1.24 +
    1.25 +#ifndef RW_ANY_H_INCLUDED
    1.26 +#define RW_ANY_H_INCLUDED
    1.27 +
    1.28 +
    1.29 +#include <testdefs.h>
    1.30 +#ifdef __SYMBIAN32__
    1.31 +#include<wchar.h>
    1.32 +#endif //__SYMBIAN32__
    1.33 +
    1.34 +class rw_any_t
    1.35 +{
    1.36 +public:
    1.37 +
    1.38 +#ifndef _RWSTD_NO_BOOL
    1.39 +    _TEST_EXPORT rw_any_t (bool);
    1.40 +#endif   // _RWSTD_NO_BOOL
    1.41 +
    1.42 +    _TEST_EXPORT rw_any_t (char);
    1.43 +    _TEST_EXPORT rw_any_t (signed char);
    1.44 +    _TEST_EXPORT rw_any_t (unsigned char);
    1.45 +
    1.46 +    _TEST_EXPORT rw_any_t (signed short);
    1.47 +    _TEST_EXPORT rw_any_t (unsigned short);
    1.48 +
    1.49 +    _TEST_EXPORT rw_any_t (signed int);
    1.50 +    _TEST_EXPORT rw_any_t (unsigned int);
    1.51 +
    1.52 +    _TEST_EXPORT rw_any_t (signed long);
    1.53 +    _TEST_EXPORT rw_any_t (unsigned long);
    1.54 +
    1.55 +#ifdef _RWSTD_LONG_LONG
    1.56 +    _TEST_EXPORT rw_any_t (signed _RWSTD_LONG_LONG);
    1.57 +    _TEST_EXPORT rw_any_t (unsigned _RWSTD_LONG_LONG);
    1.58 +#endif   // _RWSTD_LONG_LONG
    1.59 +
    1.60 +    _TEST_EXPORT rw_any_t (float);
    1.61 +    _TEST_EXPORT rw_any_t (double);
    1.62 +
    1.63 +#ifndef _RWSTD_NO_LONG_DOUBLE
    1.64 +    _TEST_EXPORT rw_any_t (long double);
    1.65 +#endif   // _RWSTD_NO_LONG_DOUBLE
    1.66 +
    1.67 +    _TEST_EXPORT rw_any_t (const void*);
    1.68 +    _TEST_EXPORT  rw_any_t (const char*);
    1.69 +
    1.70 +#ifndef _RWSTD_NO_NATIVE_WCHAR_T
    1.71 +    _TEST_EXPORT rw_any_t (wchar_t);
    1.72 +#endif   // _RWSTD_NO_NATIVE_WCHAR_T
    1.73 +
    1.74 +#ifndef _RWSTD_NO_WCHAR_T
    1.75 +    _TEST_EXPORT rw_any_t (const wchar_t*);
    1.76 +#endif   // _RWSTD_NO_WCHAR_T
    1.77 +
    1.78 +    _TEST_EXPORT rw_any_t (const rw_any_t&);
    1.79 +
    1.80 +    _TEST_EXPORT ~rw_any_t ();
    1.81 +
    1.82 +    _TEST_EXPORT rw_any_t& operator= (const rw_any_t&);
    1.83 +
    1.84 +    _TEST_EXPORT const char* tostr (const char* = 0);
    1.85 +    _TEST_EXPORT const char* type_name () const;
    1.86 +
    1.87 +    enum type_id_t {
    1.88 +        t_none,
    1.89 +        t_bool, t_schar, t_uchar, t_char,
    1.90 +        t_sshrt, t_ushrt, t_sint, t_uint, t_slong, t_ulong,
    1.91 +        t_sllong, t_ullong,
    1.92 +        t_flt, t_dbl, t_ldbl,
    1.93 +        t_wchar,
    1.94 +        t_pvoid,
    1.95 +        t_str,
    1.96 +        t_wstr
    1.97 +    };
    1.98 +
    1.99 +private:
   1.100 +
   1.101 +    union uval_t {
   1.102 +
   1.103 +#ifndef _RWSTD_NO_LONG_DOUBLE
   1.104 +        long double ldbl_;
   1.105 +#endif   // _RWSTD_NO_LONG_DOUBLE
   1.106 +        const void *pvoid_;
   1.107 +        double      dbl_;
   1.108 +#ifdef _RWSTD_LONG_LONG
   1.109 +        signed _RWSTD_LONG_LONG   sllong_;
   1.110 +        unsigned _RWSTD_LONG_LONG ullong_;
   1.111 +#endif   // _RWSTD_LONG_LONG
   1.112 +        float          flt_;
   1.113 +#ifndef _RWSTD_NO_NATIVE_WCHAR_T
   1.114 +        wchar_t        wchar_;
   1.115 +#endif   // _RWSTD_NO_NATIVE_WCHAR_T
   1.116 +        signed long    slong_;
   1.117 +        unsigned long  ulong_;
   1.118 +        signed int     sint_;
   1.119 +        unsigned int   uint_;
   1.120 +        signed short   sshrt_;
   1.121 +        unsigned short ushrt_;
   1.122 +        signed char    schar_;
   1.123 +        unsigned char  uchar_;
   1.124 +        char           char_;
   1.125 +#ifndef _RWSTD_NO_BOOL
   1.126 +        bool           bool_;
   1.127 +#endif   // _RWSTD_NO_BOOL
   1.128 +    } val_;
   1.129 +
   1.130 +    char      *str_;
   1.131 +    type_id_t  tid_;
   1.132 +};
   1.133 +
   1.134 +
   1.135 +#define TOSTR(x)   rw_any_t (x).tostr ()
   1.136 +
   1.137 +
   1.138 +#endif   // RW_ANY_H_INCLUDED