mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #241 Add class CHostNode representing a enumerated host
This commit is contained in:
34
src/plugins/simulator/fs9/host_node.cpp
Normal file
34
src/plugins/simulator/fs9/host_node.cpp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/* Copyright (C) 2014
|
||||||
|
* swift project community / contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of Swift Project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "host_node.h"
|
||||||
|
|
||||||
|
namespace BlackSimPlugin
|
||||||
|
{
|
||||||
|
namespace Fs9
|
||||||
|
{
|
||||||
|
CHostNode::CHostNode()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CHostNode::CHostNode(const CHostNode &other)
|
||||||
|
: m_appDesc(other.m_appDesc), m_sessionName(other.m_sessionName)
|
||||||
|
{
|
||||||
|
other.m_hostAddress->Duplicate(&m_hostAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
CHostNode::~CHostNode()
|
||||||
|
{
|
||||||
|
if (m_hostAddress)
|
||||||
|
m_hostAddress->Release();
|
||||||
|
|
||||||
|
m_hostAddress = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
64
src/plugins/simulator/fs9/host_node.h
Normal file
64
src/plugins/simulator/fs9/host_node.h
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/* Copyright (C) 2014
|
||||||
|
* swift project community / contributors
|
||||||
|
*
|
||||||
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||||
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of Swift Project,
|
||||||
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||||
|
* contained in the LICENSE file.
|
||||||
|
*/
|
||||||
|
#ifndef BLACKSIMPLUGIN_FS9_HOST_NODE_H
|
||||||
|
#define BLACKSIMPLUGIN_FS9_HOST_NODE_H
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <dplay8.h>
|
||||||
|
|
||||||
|
//! \file
|
||||||
|
|
||||||
|
namespace BlackSimPlugin
|
||||||
|
{
|
||||||
|
namespace Fs9
|
||||||
|
{
|
||||||
|
//! Class representing a enumerated host node
|
||||||
|
struct CHostNode
|
||||||
|
{
|
||||||
|
//! Constructor
|
||||||
|
CHostNode();
|
||||||
|
|
||||||
|
//! Copy constructor
|
||||||
|
CHostNode(const CHostNode &other);
|
||||||
|
|
||||||
|
//! Destructor
|
||||||
|
~CHostNode();
|
||||||
|
|
||||||
|
//! Returns the hosts application description
|
||||||
|
DPN_APPLICATION_DESC getApplicationDesc() const { return m_appDesc; }
|
||||||
|
|
||||||
|
//! Set the hosts application description
|
||||||
|
void setApplicationDesc(const DPN_APPLICATION_DESC &appDesc) { m_appDesc = appDesc; }
|
||||||
|
|
||||||
|
//! Returns a pointer to the hosts address
|
||||||
|
IDirectPlay8Address **getHostAddressPtr() { return &m_hostAddress; }
|
||||||
|
|
||||||
|
//! Returns the hosts address
|
||||||
|
IDirectPlay8Address *getHostAddress() { return m_hostAddress; }
|
||||||
|
|
||||||
|
//! Sets hosts address
|
||||||
|
void setHostAddress(IDirectPlay8Address *address) { m_hostAddress = address; }
|
||||||
|
|
||||||
|
//! Returns the sessions name
|
||||||
|
QString getSessionName() const { return m_sessionName; }
|
||||||
|
|
||||||
|
//! Set the session name
|
||||||
|
void setSessionName(const QString &name) { m_sessionName = name; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
IDirectPlay8Address *m_hostAddress = nullptr;
|
||||||
|
DPN_APPLICATION_DESC m_appDesc;
|
||||||
|
QString m_sessionName;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //BLACKSIMPLUGIN_FS9_HOST_NODE_H
|
||||||
Reference in New Issue
Block a user