MachineIntelligenceCore:Toolchain
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ApplicationState.hpp File Reference

ApplicationState declaration. More...

#include <boost/atomic.hpp>
#include <boost/thread/mutex.hpp>
#include <configuration/PropertyTree.hpp>
Include dependency graph for ApplicationState.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mic::application::ApplicationState
 Class storing the state of the application (modes, sleep interval etc.). Defined in the form of a singleton, with double-checked locking pattern (DCLP) based access to instance. More...
 

Namespaces

 mic
 Main Machine Intelligence Core namespace.
 
 mic::application
 Contains base application-related classes, types and types.
 

Macros

#define APP_STATE   mic::application::ApplicationState::getInstance()
 Macro returning application state instance. More...
 
#define APP_SLEEP()   usleep(APP_STATE->getSleepInterval())
 Macro which sleeps the application for a time specified by the sleep_interval variable stored in APP_STATE. More...
 
#define APP_DATA_SYNCHRONIZATION_SCOPED_LOCK()   boost::mutex::scoped_lock lock(APP_STATE->dataSynchronizationMutex())
 Macro creating a scoped lock with the use of data_synchronizaton_mutex stored by WindowManager. More...
 

Detailed Description

ApplicationState declaration.

Copyright (C) tkornuta, IBM Corporation 2015-2019

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Author
tkornuta
Date
Nov 16, 2015

Definition in file ApplicationState.hpp.

Macro Definition Documentation

#define APP_DATA_SYNCHRONIZATION_SCOPED_LOCK ( )    boost::mutex::scoped_lock lock(APP_STATE->dataSynchronizationMutex())

Macro creating a scoped lock with the use of data_synchronizaton_mutex stored by WindowManager.

Author
tkornuta

Definition at line 331 of file ApplicationState.hpp.

Referenced by mic::application::ContinuousLearningApplication::run(), mic::application::TrainThenTestApplication::run(), mic::application::EpisodicTrainAndTestApplication::run(), and mic::application::Application::run().

#define APP_SLEEP ( )    usleep(APP_STATE->getSleepInterval())

Macro which sleeps the application for a time specified by the sleep_interval variable stored in APP_STATE.

Author
tkornuta

Definition at line 324 of file ApplicationState.hpp.

Referenced by mic::application::ContinuousLearningApplication::run(), mic::application::TrainThenTestApplication::run(), mic::application::EpisodicTrainAndTestApplication::run(), and mic::application::Application::run().