14 #define FUNC_TYPE "update_list"
15 #define FUNC_NAME "update_log_list"
17 using namespace kome::operation;
22 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
23 #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
46 if( operation ==
NULL ){
57 optInf.operation = operation;
58 optInf.iState = TYPE_NONE;
68 if( opt == operation ){
104 std::vector<Operation*> opt;
111 if( index > (
int)opt.size() || index <= -1 ){
130 std::vector<Operation*> opt;
137 if( index > (
int)opt.size() || index <= -1 ){
149 std::string folderName =
"Operation";
150 std::string operatFolder =
getpath( msppMgr.
getTmpDir(), folderName.c_str() );
160 strName =
"UpdatePath" + strName ;
162 std::string datFile = msppMgr.
getTmpFileName( strName.c_str(),
".dat", folderName.c_str() );
175 std::string folderName =
"Operation";
176 std::string operatFolder =
getpath( msppMgr.
getTmpDir(), folderName.c_str() );
187 strName =
"PrevPath" + strName ;
189 std::string datFile = msppMgr.
getTmpFileName( strName.c_str(),
".dat", folderName.c_str() );
210 optInf.iState = TYPE_FINISH;
211 optInf.operation = operation;
233 optInf.iState = TYPE_CANCEL;
234 optInf.operation = operation;
258 void OperationManager::SendStatusToList(){
261 kome::plugin::PluginFunctionItem* item;
263 kome::plugin::PluginManager& plgMgr = kome::plugin::PluginManager::getInstance();
264 unsigned int iFuncItem = plgMgr.getNumberOfFunctionItems( FUNC_TYPE );
265 item = plgMgr.getFunctionItem( FUNC_TYPE, FUNC_NAME );
267 item->getCall()->invoke(
NULL );
void addOperation(Operation *operation)
add managed operation
static MsppManager & getInstance()
gets MsppManager object (This is the only object.)
int getNumberOfCanceledOperations()
gets the number of canceled operations
void moveToFinished(Operation *operation)
moves the operation to the finished queue.
implements of GridEmailTextCtrl class
static OperationManager & getInstance()
get operation manager object (This is the only object.)
std::string getPrevFilePath()
gets previouse data file path
const char * getPreviousDataFilePath(Operation *operation)
gets the file path to save the previous status
bool fileexists(const char *path)
judge whether file exists
int getState(const unsigned int index)
gets the operation status
const char * getTmpDir()
gets temporary file directory name
std::string m_updateFilePath
std::string getUpdateFilePath()
gets udate data file path
void removeOperation(Operation *operation)
remove managed operation
bool makedirectory(const char *path)
creates directory
Operation * getCanceledOperation(int i)
gets the canceled operation
const char * getOperationName()
gets operation name
Operation * getFinishedOperation(int i)
gets the finished operation.
std::string m_prevFilePath
void clearCanceledOperation()
clears canceled operations
Operation * getOperation(const unsigned int index)
gets the managed operation
OperationManager()
constructor
unsigned int getNumberOfOperations()
gets the number of managed operation
virtual ~OperationManager()
destructor
void movetoCanseled(Operation *operation)
move the operation to the canceled queue.
const char * getUpdateDataFilePath(Operation *operation)
the file path to save the update status
std::string getTmpFileName(const char *prefix, const char *suffix, const char *dir=NULL)
gets temporary file name
Operation information class.
operation management class
std::vector< OperationInfo > m_operations
void setState(const unsigned int index, int state)
sets the operation stateus
int getNumberOfFinishedOperations()
gets the number of finished operations
std::string getpath(const char *dir, const char *file)
get file path