📄 base.h
字号:
/////////////////////////////////////////////////////////////////////////////
//
// OPC Trend VC++ Client: Base.h
// (Template File)
//
/////////////////////////////////////////////////////////////////////////////
//
// Author: Raphael Imhof
// Initial Date: 11/04/98
// $Workfile: Base.h $
// $Revision: 1 $
// $Date: 7/27/99 5:24p $
// Target System: Microsoft Windows NT 4.0
// Environment: Visual C++ 5.0 / OPC DataAccess 1.0 / 2.0
// Remarks:
//
/////////////////////////////////////////////////////////////////////////////
//
// Description: CBase template used by CItem and CGroup
// Common functionality.
//
//
/////////////////////////////////////////////////////////////////////////////
//
// History of Changes (Please remove very old comments and blank lines!)
// $Log: /IDK/OPCServer/clients/VC++/Trend/Base.h $
//
// 1 7/27/99 5:24p Imhof
//
// 1 7/27/99 5:19p Imhof
//
// 4 1/15/99 7:04p Imhof
// Updated legal notice.
//
// 3 12/15/98 10:30a Imhof
// Modifications for OPC 2.0
//
// 2 11/06/98 5:53p Imhof
// Added header, comment and made some small code changes.
//
//
// $Nokeywords:$ (To avoid useless search while checking in.)
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998, Siemens Building Technologies, Inc. Landis Division
//
// SIEMENS BUILDING TECHNOLOGIES, INC. IS PROVIDING THE FOLLOWING
// EXAMPLES OF CODE AS SAMPLE ONLY.
//
// SIEMENS BUILDING TECHNOLOGIES, INC. MAKES NO REPRESENTATIONS
// OR WARRANTIES OF ANY KIND WITH RESPECT TO THE VALIDTY OF THE
// CODES OR DESIRED RESULTS AND DISCLAIMS ALL SUCH
// REPRESENTATIONS AND WARRANTIES, INCLUDING FOR EXAMPLE,
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE. SIEMENS BUILIDNG TECHNOLOGIES, INC. DOES NOT
// REPRESENT OR WARRANT THAT THE FOLLOWING CODE SAMPLES ARE
// ACCURATE, VALID, COMPLETE OR CURRENT.
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_BASE_H__451D47C8_2B19_11D2_AD89_00104B2C9D06__INCLUDED_)
#define AFX_BASE_H__451D47C8_2B19_11D2_AD89_00104B2C9D06__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <opcda.h>
template<class T>
class CBase : public CObject
{
public:
OPCHANDLE GetHandle();
void SetHandle(OPCHANDLE opcHandle);
CString GetName();
void SetName(CString name);
CBase();
virtual ~CBase();
void SetInterface(CComPtr<T> com_ptr);
CComPtr<T> GetInterface();
private:
OPCHANDLE m_handle;
CString m_name;
CComPtr<T> m_interface;
};
/// member functions
template<class T> inline CBase<T>::CBase()
{
}
template<class T> inline CBase<T>::~CBase()
{
}
template<class T> inline void CBase<T>::SetName(CString name)
{
m_name = name;
}
template<class T> inline CString CBase<T>::GetName()
{
return m_name;
}
template<class T> void CBase<T>::SetHandle(OPCHANDLE opcHandle)
{
m_handle = opcHandle;
}
template<class T> inline OPCHANDLE CBase<T>::GetHandle()
{
return m_handle;
}
template<class T> inline void CBase<T>::SetInterface(CComPtr<T> com_ptr)
{
m_interface = com_ptr;
}
template<class T> inline CComPtr<T> CBase<T>::GetInterface()
{
return m_interface;
}
#endif // !defined(AFX_BASE_H__451D47C8_2B19_11D2_AD89_00104B2C9D06__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -