Minor update:
- FunctionCore: - Set Function Type in Init() - SelectableBare: - Remove unnecesary initialisation in constructor - SelectableCore: - Remove code duplicated in SelectableBare
This commit is contained in:
@@ -27,9 +27,9 @@ CApplication::CApplication( EDebugLevel pLogLevel )
|
|||||||
// Set signal handlers
|
// Set signal handlers
|
||||||
ConfigureSignalHandlers();
|
ConfigureSignalHandlers();
|
||||||
|
|
||||||
DefinitionFile = NULL;
|
DefinitionFile = NULL;
|
||||||
ConfigFile = NULL;
|
ConfigFile = NULL;
|
||||||
AddressFile = NULL;
|
AddressFile = NULL;
|
||||||
|
|
||||||
// Create output logger
|
// Create output logger
|
||||||
Log = new CLogCore( stdout );
|
Log = new CLogCore( stdout );
|
||||||
|
|||||||
@@ -30,9 +30,8 @@ extern CApplication * Application;
|
|||||||
CFunctionCore::CFunctionCore( const char * pName, const char * pType ) : Type( pType )
|
CFunctionCore::CFunctionCore( const char * pName, const char * pType ) : Type( pType )
|
||||||
{
|
{
|
||||||
// Set name
|
// Set name
|
||||||
if (pName) {
|
if (pName)
|
||||||
Name = strdup( pName );
|
Name = strdup( pName );
|
||||||
}
|
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
Log = Application->Log;
|
Log = Application->Log;
|
||||||
@@ -101,6 +100,9 @@ bool CFunctionCore::Init( CDataMember * FunctionConfig )
|
|||||||
if (!FunctionConfig )
|
if (!FunctionConfig )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Set Type
|
||||||
|
FunctionConfig->SetChStr( "Type", Type );
|
||||||
|
|
||||||
// Configure Logging/Debugging
|
// Configure Logging/Debugging
|
||||||
LogConfig = FunctionConfig->GetChild( "Log", true );
|
LogConfig = FunctionConfig->GetChild( "Log", true );
|
||||||
pLogLevel = Log->ReadLogLevel( LogConfig );
|
pLogLevel = Log->ReadLogLevel( LogConfig );
|
||||||
|
|||||||
@@ -38,9 +38,6 @@ CSelectableBare::CSelectableBare( const char * pName, const char * pType ) : CFu
|
|||||||
{
|
{
|
||||||
// Quick access
|
// Quick access
|
||||||
Selector = Application->Selector;
|
Selector = Application->Selector;
|
||||||
|
|
||||||
// Handles
|
|
||||||
FirstHandle = NULL;
|
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -42,27 +42,11 @@ CFunctionCore * NewSelectableCore( const char * Name ) {
|
|||||||
|
|
||||||
CSelectableCore::CSelectableCore( const char * pName, const char * pType ) : CSelectableBare( pName, pType )
|
CSelectableCore::CSelectableCore( const char * pName, const char * pType ) : CSelectableBare( pName, pType )
|
||||||
{
|
{
|
||||||
// Quick access
|
|
||||||
Selector = Application->Selector;
|
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
CSelectableCore::~CSelectableCore()
|
CSelectableCore::~CSelectableCore()
|
||||||
{
|
{
|
||||||
THandle * NextHandle = NULL;
|
|
||||||
|
|
||||||
// Destroy File Handles
|
|
||||||
while (FirstHandle)
|
|
||||||
{
|
|
||||||
// Close handle if open
|
|
||||||
if ((FirstHandle->State == csOpen) || (FirstHandle->State == csWaitingtoOpen)) {
|
|
||||||
Close( FirstHandle, false );
|
|
||||||
}
|
|
||||||
|
|
||||||
NextHandle = FirstHandle->Next;
|
|
||||||
DestroyHandle( FirstHandle );
|
|
||||||
FirstHandle = NextHandle;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user