variant.h File Reference

#include <comet/config.h>
#include <comet/datetime.h>
#include <comet/error_fwd.h>
#include <comet/assert.h>
#include <comet/common.h>
#include <comet/bstr.h>
#include <comet/currency.h>
#include <iostream>
#include <comet/error.h>
#include <comet/ptr.h>

Include dependency graph for variant.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  comet
namespace  comet::impl
namespace  std

Classes

class  comet::variant_t
 Wrapper for VARIANT type. More...
struct  comet::variant_t::tagMissing
struct  comet::variant_t::tagNothing
struct  comet::variant_t::tagNull

Defines

#define COMET_VARIANT_OPERATOR(op, name)
#define COMET_VARIANT_CONVERTERS_EX_(type, vartype, func)
#define COMET_VARIANT_CONVERTERS_EXPLICIT(type, vartype, funcname)   COMET_VARIANT_CONVERTERS_EX_(type,vartype, type funcname)
#define COMET_VARIANT_CONVERTERS(type, vartype)   COMET_VARIANT_CONVERTERS_EX_(type,vartype, operator type )
#define COMET_VARIANT_FRIENDS(type)
#define __COMET_VARAIANT_OUT(vartype)   case VT_##vartype: os << V_##vartype(this); break
#define __COMET_VARAIANT_OUT_CAST(vartype, cast)   case VT_##vartype: os << cast(V_##vartype(this)); break

Functions

 COMET_VARIANT_FRIENDS (short)
 COMET_VARIANT_FRIENDS (int)
 COMET_VARIANT_FRIENDS (long)
 COMET_VARIANT_FRIENDS (float)
 COMET_VARIANT_FRIENDS (double)
 COMET_VARIANT_FRIENDS (const char *)
 COMET_VARIANT_FRIENDS (const wchar_t *)
 COMET_VARIANT_FRIENDS (const std::wstring &)
 COMET_VARIANT_FRIENDS (const std::string &)
 COMET_VARIANT_FRIENDS (const DECIMAL &)
template<> void swap (comet::variant_t &x, comet::variant_t &y) COMET_STD_SWAP_NOTHROW
bool operator!= (const bstr_t &b, const variant_t &v)
bool operator== (const bstr_t &b, const variant_t &v)
bool operator< (const bstr_t &b, const variant_t &v)
bool operator> (const bstr_t &b, const variant_t &v)
bool operator<= (const bstr_t &b, const variant_t &v)
bool operator>= (const bstr_t &b, const variant_t &v)


Detailed Description

Wrapper for VARIANT.

Define Documentation

#define COMET_VARIANT_CONVERTERS_EX_ type,
vartype,
func   ) 
 

Value:

variant_t(type x) throw() \ { \ V_##vartype(this) = x; V_VT(this) = VT_##vartype; \ } \ \ func() const \ { \ if (V_VT(this) == VT_##vartype) return V_##vartype(this); \ variant_t v(*this, VT_##vartype); \ return V_##vartype(v.get_var()); \ } \ \ variant_t& operator=(type x) throw() \ { \ clear(); \ V_##vartype(this) = x; V_VT(this) = VT_##vartype; \ return *this; \ }

#define COMET_VARIANT_FRIENDS type   ) 
 

Value:

inline bool operator!=(type x, const variant_t& y) { return y != x; } \ inline bool operator==(type x, const variant_t& y) { return y == x; } \ inline bool operator<(type x, const variant_t& y) { return y > x; } \ inline bool operator<=(type x, const variant_t& y) { return y >= x; } \ inline bool operator>(type x, const variant_t& y) { return y < x; } \ inline bool operator>=(type x, const variant_t& y) { return y <= x; }

#define COMET_VARIANT_OPERATOR op,
name   ) 
 

Value:

variant_t operator##op(const variant_t& x) const \ { \ VARIANT t; \ Var##name(const_cast<VARIANT*>(get_var()), const_cast<VARIANT*>(x.get_var()), &t) | raise_exception; \ return auto_attach(t); \ } \ \ variant_t& operator##op##=(const variant_t& x) \ { \ return operator=(operator##op(x)); \ }