.h-------->>>
#ifndef __HSChannel_H__
#define __HSChannel_H__
#pragma once
#include "HSTool.h"
class HSChannel
{
public:
HSChannel(void);
~HSChannel(void);
static HSChannel* SharedChannel();
};
#endif
.cpp--------->>>
#include "HSChannel.h"
static HSChannel* s_SharedChannel = NULL;
HSChannel::HSChannel(void)
{
}
HSChannel::~HSChannel(void)
{
}
HSChannel* HSChannel::SharedChannel()
{
if(s_SharedChannel == NULL)
{
s_SharedChannel = new HSChannel();
}
return s_SharedChannel;
}