// WMSOAPStructType.h: interface for the WMSOAPStructType class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2001 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// WMSOAPWSDLClient class - implementation of SOAP-ENC:Struct container
//  
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WMSOAPSTRUCTTYPE_H__AEFC8903_47F1_4731_9024_532669D80AE9__INCLUDED_)
#define AFX_WMSOAPSTRUCTTYPE_H__AEFC8903_47F1_4731_9024_532669D80AE9__INCLUDED_

#include "comdef.h"
#include <list>
using namespace std;

// WMSOAPStructMember class
//
class WMSOAPStructMember
{
public:

	WMSOAPStructMember(BSTR bstrName, const VARIANT& varValue);
	WMSOAPStructMember(BSTR bstrName, BSTR bstrNS, const VARIANT& varValue);
	WMSOAPStructMember() {}

	_variant_t *GetValue() { return &m_varValue; }
	const _bstr_t& GetName() { return m_bstrName; }
	const _bstr_t& GetNS() { return m_bstrNS; }

protected:

	_bstr_t		m_bstrName;
	_bstr_t		m_bstrNS;
	_variant_t	m_varValue;
};

// WMSOAPStructType class
//
class WMSOAPStructType  
{
public:
	WMSOAPStructType();
	virtual ~WMSOAPStructType();

	bool SetMember(BSTR bstrName, VARIANT varValue);
	bool GetMember(BSTR bstrName, VARIANT *pvarValue);
	bool GetFirstMember(BSTR *pbstrName, VARIANT *pvarValue, long *pPos);
	bool GetNextMember(BSTR *pbstrName, VARIANT *pvarValue, long *pPos);
	bool SetMemberQN(BSTR bstrName, BSTR bstrNS, VARIANT varValue);
	bool GetMemberQN(BSTR bstrName, BSTR bstrNS, VARIANT *pvarValue);
	bool GetFirstMemberQN(BSTR *pbstrName, BSTR *pbstrNS, VARIANT *pvarValue, long *pPos);
	bool GetNextMemberQN(BSTR *pbstrName, BSTR *pbstrNS, VARIANT *pvarValue, long *pPos);

protected:

	list<WMSOAPStructMember *>	m_listMembers;
};

#endif // !defined(AFX_WMSOAPSTRUCTTYPE_H__AEFC8903_47F1_4731_9024_532669D80AE9__INCLUDED_)
