Nebula
Loading...
Searching...
No Matches
interfacebase.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
15#include "messaging/asyncport.h"
16#include "util/stringatom.h"
17
18//------------------------------------------------------------------------------
19namespace Interface
20{
22{
24public:
28 virtual ~InterfaceBase();
29
31 virtual void AttachHandler(const Ptr<Messaging::Handler>& h);
33 virtual void Open();
35 virtual void Close();
36
38 const Util::StringAtom& GetCompanyName() const;
40 const Util::StringAtom& GetAppName() const;
43
44private:
50 void SetRootDirectory(const Util::StringAtom& dir);
51
55};
56
57//------------------------------------------------------------------------------
60inline void
65
66//------------------------------------------------------------------------------
69inline const Util::StringAtom&
71{
72 return this->companyName;
73}
74
75//------------------------------------------------------------------------------
78inline void
80{
81 this->appName = n;
82}
83
84//------------------------------------------------------------------------------
87inline const Util::StringAtom&
89{
90 return this->appName;
91}
92
93//------------------------------------------------------------------------------
96inline void
101
102//------------------------------------------------------------------------------
105inline const Util::StringAtom&
107{
108 return this->rootDirectory;
109}
110
111} // namespace Interface
112//------------------------------------------------------------------------------
Base class for interfaces.
Definition interfacebase.h:22
void SetRootDirectory(const Util::StringAtom &dir)
set the root directory (default is home:)
Definition interfacebase.h:97
virtual ~InterfaceBase()
destructor
Definition interfacebase.cc:29
virtual void AttachHandler(const Ptr< Messaging::Handler > &h)
attach a handler to the port (call before open!)
Definition interfacebase.cc:65
Util::StringAtom appName
Definition interfacebase.h:54
virtual void Open()
open the async port
Definition interfacebase.cc:38
const Util::StringAtom & GetCompanyName() const
get the company name
Definition interfacebase.h:70
__DeclareClass(InterfaceBase)
const Util::StringAtom & GetAppName() const
get the application name
Definition interfacebase.h:88
void SetAppName(const Util::StringAtom &appName)
set the application name
Definition interfacebase.h:79
void SetCompanyName(const Util::StringAtom &companyName)
set the company name
Definition interfacebase.h:61
virtual void Close()
close the async port
Definition interfacebase.cc:54
InterfaceBase()
constructor
Definition interfacebase.cc:20
const Util::StringAtom & GetRootDirectory() const
get the root directory
Definition interfacebase.h:106
Util::StringAtom companyName
Definition interfacebase.h:53
Util::StringAtom rootDirectory
Definition interfacebase.h:52
The AsyncPort class runs its handlers in a separate thread, so that message processing happens in a s...
Definition asyncport.h:22
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
A StringAtom.
Definition stringatom.h:22
Definition interfacebase.cc:12