casa  $Rev:20696$
type_variant.h
Go to the documentation of this file.
00001 #ifndef type_variant_h_
00002 #define type_variant_h_
00003 
00004 #include <WX/Utils/type.h>
00005 #include <string>
00006 #include <xmlcasa/value_variant.h>
00007 
00008 namespace casac {
00009 
00010 class WX::Utils::Value;
00011 
00012 class VariantType : public WX::Utils::Type {
00013   public:
00014 
00015     static const VariantType *instance( );
00016 
00017     VariantValue *narrow(WX::Utils::Value*) const;
00018     const VariantValue *const_narrow(const WX::Utils::Value*) const;
00019 
00020     VariantType();
00021     ~VariantType();
00022 
00024     VariantValue *create() const;
00025     bool can_assign(const WX::Utils::Value&, WX::Utils::Error* =NULL) const;
00026     void assign(WX::Utils::Value* self, const WX::Utils::Value* that) const;
00027 
00031     WX::Utils::Value* fit(WX::Utils::Value*) const;
00032 
00034     const std::string& typestr() const;
00035 
00036     WX::Utils::Value* shallow_copy(const WX::Utils::Value* self) const;
00037     WX::Utils::Value* toplevel_copy(const WX::Utils::Value* self) const;
00038     WX::Utils::Value* deep_copy(const WX::Utils::Value* self) const;
00039 
00041     const WX::Utils::Value* default_value() const;
00042 
00043     int compare(const WX::Utils::Value* self, const WX::Utils::Value* that) const;
00044 
00045     // HACK ALERT!
00046     void convert_from(WX::Utils::Value* self, const WX::Utils::Value* that) const;
00047 
00048   public:
00049     LTA_MEMDECL(1);
00050   private:
00051     static const VariantValue *default_value_;
00052 };
00053 LTA_STATDEF(VariantType, 1);
00054 
00055 }// /namespace
00056 
00057 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines