// This file is generated by omniidl (C++ backend)- omniORB_4_1. Do not edit.
#ifndef __boxes_defs_hh__
#define __boxes_defs_hh__

#ifndef __CORBA_mStringValue__
#define __CORBA_mStringValue__

class StringValue;

class StringValue_Helper {
public:
  static void add_ref(StringValue*);
  static void remove_ref(StringValue*);
  static void marshal(StringValue*, cdrStream&);
  static StringValue* unmarshal(cdrStream&);
};

typedef _CORBA_Value_Var    <StringValue,StringValue_Helper> StringValue_var;
typedef _CORBA_Value_Member <StringValue,StringValue_Helper> StringValue_member;
typedef _CORBA_Value_OUT_arg<StringValue,StringValue_Helper> StringValue_out;

#endif // __CORBA_mStringValue__

class StringValue :
  public CORBA::DefaultValueRefCountBase
{
public:
  typedef StringValue_var _var_type;

  inline StringValue()
    : _pd_boxed(OMNI_CONST_CAST(char*,_CORBA_String_helper::empty_string))
  {}
  inline StringValue(const StringValue& _v) :
    ValueBase (_v), DefaultValueRefCountBase (_v) {
    if (_v._pd_boxed) _pd_boxed = _CORBA_String_helper::dup(_v._pd_boxed);
    else _pd_boxed = 0;
  }
  inline StringValue(char* _v) {
    _pd_boxed = _v;
  }
  inline StringValue(const char* _v) {
    if (_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline StringValue(const CORBA::String_var& _v) {
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline StringValue(const CORBA::String_member& _v) {
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline StringValue(const _CORBA_String_element& _v) {
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }

  inline StringValue& operator=(char* _v) {
    _CORBA_String_helper::free(_pd_boxed);
    _pd_boxed = _v;
    return *this;
  }
  inline StringValue& operator=(const char* _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if (_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }
  inline StringValue& operator=(const CORBA::String_var& _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }
  inline StringValue& operator=(const CORBA::String_member& _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }
  inline StringValue& operator=(const _CORBA_String_element& _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }

  inline const char* _value() const {
    return _pd_boxed;
  }
  inline void _value(char* _v) {
    _CORBA_String_helper::free(_pd_boxed);
    _pd_boxed = _v;
  }
  inline void _value(const char* _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if (_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline void _value(const CORBA::String_var& _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline void _value(const CORBA::String_member& _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline void _value(const _CORBA_String_element& _v) {
    _CORBA_String_helper::free(_pd_boxed);
    if ((const char*)_v) _pd_boxed = _CORBA_String_helper::dup(_v);
    else _pd_boxed = 0;
  }

  inline char& operator[] (_CORBA_ULong _i) {
    if (!_pd_boxed) {
      _CORBA_bound_check_error();	// never return
    }
    return _pd_boxed[_i];
  }
  inline char operator[] (_CORBA_ULong _i) const {
    if (!_pd_boxed) {
      _CORBA_bound_check_error();	// never return
    }
    return _pd_boxed[_i];
  }

  inline const char* _boxed_in() const {
    return _pd_boxed;
  }
  inline char*& _boxed_inout() {
    return _pd_boxed;
  }
  inline char*& _boxed_out() {
    return _pd_boxed;
  }



  static StringValue* _downcast(ValueBase*);

#ifdef OMNI_HAVE_COVARIANT_RETURNS
  virtual StringValue* _copy_value();
#else
  virtual CORBA::ValueBase* _copy_value();
#endif

  // omniORB internal
  virtual const char* _NP_repositoryId() const;
  virtual const char* _NP_repositoryId(CORBA::ULong& _hashval) const;

  virtual const _omni_ValueIds* _NP_truncatableIds() const;

  virtual CORBA::Boolean _NP_custom() const;
  virtual CORBA::Boolean _NP_box() const;

  virtual void* _ptrToValue(const char* id);

  static void _NP_marshal(StringValue*, cdrStream&);
  static StringValue* _NP_unmarshal(cdrStream&);

  virtual void _PR_marshal_state(cdrStream&) const;
  virtual void _PR_unmarshal_state(cdrStream&);
  virtual void _PR_copy_state(StringValue*);

  static _core_attr const char* _PD_repoId;

protected:
  ~StringValue();
private:
  void operator=(const StringValue&);

  char* _pd_boxed;
};

_CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_StringValue;

#ifndef __CORBA_mWStringValue__
#define __CORBA_mWStringValue__

class WStringValue;

class WStringValue_Helper {
public:
  static void add_ref(WStringValue*);
  static void remove_ref(WStringValue*);
  static void marshal(WStringValue*, cdrStream&);
  static WStringValue* unmarshal(cdrStream&);
};

typedef _CORBA_Value_Var    <WStringValue,WStringValue_Helper> WStringValue_var;
typedef _CORBA_Value_Member <WStringValue,WStringValue_Helper> WStringValue_member;
typedef _CORBA_Value_OUT_arg<WStringValue,WStringValue_Helper> WStringValue_out;

#endif // __CORBA_mWStringValue__

class WStringValue :
  public CORBA::DefaultValueRefCountBase
{
public:
  typedef WStringValue_var _var_type;

  inline WStringValue()
    : _pd_boxed(OMNI_CONST_CAST(CORBA::WChar*,_CORBA_WString_helper::empty_wstring))
  {}
  inline WStringValue(const WStringValue& _v) :
    ValueBase (_v), DefaultValueRefCountBase (_v) {
    if (_v._pd_boxed) _pd_boxed = _CORBA_WString_helper::dup(_v._pd_boxed);
    else _pd_boxed = 0;
  }
  inline WStringValue(CORBA::WChar* _v) {
    _pd_boxed = _v;
  }
  inline WStringValue(const CORBA::WChar* _v) {
    if (_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline WStringValue(const CORBA::WString_var& _v) {
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline WStringValue(const CORBA::WString_member& _v) {
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline WStringValue(const _CORBA_WString_element& _v) {
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }

  inline WStringValue& operator=(CORBA::WChar* _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    _pd_boxed = _v;
    return *this;
  }
  inline WStringValue& operator=(const CORBA::WChar* _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if (_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }
  inline WStringValue& operator=(const CORBA::WString_var& _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }
  inline WStringValue& operator=(const CORBA::WString_member& _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }
  inline WStringValue& operator=(const _CORBA_WString_element& _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
    return *this;
  }

  inline const CORBA::WChar* _value() const {
    return _pd_boxed;
  }
  inline void _value(CORBA::WChar* _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    _pd_boxed = _v;
  }
  inline void _value(const CORBA::WChar* _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if (_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline void _value(const CORBA::WString_var& _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline void _value(const CORBA::WString_member& _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }
  inline void _value(const _CORBA_WString_element& _v) {
    _CORBA_WString_helper::free(_pd_boxed);
    if ((const CORBA::WChar*)_v) _pd_boxed = _CORBA_WString_helper::dup(_v);
    else _pd_boxed = 0;
  }

  inline CORBA::WChar& operator[] (_CORBA_ULong _i) {
    if (!_pd_boxed) {
      _CORBA_bound_check_error();	// never return
    }
    return _pd_boxed[_i];
  }
  inline CORBA::WChar operator[] (_CORBA_ULong _i) const {
    if (!_pd_boxed) {
      _CORBA_bound_check_error();	// never return
    }
    return _pd_boxed[_i];
  }

  inline const CORBA::WChar* _boxed_in() const {
    return _pd_boxed;
  }
  inline CORBA::WChar*& _boxed_inout() {
    return _pd_boxed;
  }
  inline CORBA::WChar*& _boxed_out() {
    return _pd_boxed;
  }



  static WStringValue* _downcast(ValueBase*);

#ifdef OMNI_HAVE_COVARIANT_RETURNS
  virtual WStringValue* _copy_value();
#else
  virtual CORBA::ValueBase* _copy_value();
#endif

  // omniORB internal
  virtual const char* _NP_repositoryId() const;
  virtual const char* _NP_repositoryId(CORBA::ULong& _hashval) const;

  virtual const _omni_ValueIds* _NP_truncatableIds() const;

  virtual CORBA::Boolean _NP_custom() const;
  virtual CORBA::Boolean _NP_box() const;

  virtual void* _ptrToValue(const char* id);

  static void _NP_marshal(WStringValue*, cdrStream&);
  static WStringValue* _NP_unmarshal(cdrStream&);

  virtual void _PR_marshal_state(cdrStream&) const;
  virtual void _PR_unmarshal_state(cdrStream&);
  virtual void _PR_copy_state(WStringValue*);

  static _core_attr const char* _PD_repoId;

protected:
  ~WStringValue();
private:
  void operator=(const WStringValue&);

  CORBA::WChar* _pd_boxed;
};

_CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_WStringValue;

#endif

