MoNetCommandInfoManager.cc

Go to the documentation of this file.
00001 //
00002 // Copyright 2002 Sony Corporation 
00003 //
00004 // Permission to use, copy, modify, and redistribute this software for
00005 // non-commercial use is hereby granted.
00006 //
00007 // This software is provided "as is" without warranty of any kind,
00008 // either expressed or implied, including but not limited to the
00009 // implied warranties of fitness for a particular purpose.
00010 //
00011 
00012 #include "MoNetCommandInfoManager.h"
00013 
00014 MoNetCommandInfoManager::MoNetCommandInfoManager() : infoMap(), infoList()
00015 {
00016 }
00017 
00018 MoNetCommandInfoManager::~MoNetCommandInfoManager()
00019 {
00020 }
00021 
00022 MoNetCommandInfo* 
00023 MoNetCommandInfoManager::New()
00024 {
00025     MoNetCommandInfo* info = new MoNetCommandInfo(false);
00026     infoList.push_back(info);
00027     return info;
00028 }
00029 
00030 MoNetCommandInfo* 
00031 MoNetCommandInfoManager::New(MoNetCommandID commandID, bool useSyncKey)
00032 {
00033     MoNetCommandInfo* info = new MoNetCommandInfo(useSyncKey);
00034     infoMap[commandID] = info;
00035     return info;
00036 }
00037 
00038 MoNetCommandInfo*
00039 MoNetCommandInfoManager::Find(MoNetCommandID commandID)
00040 {
00041     map<MoNetCommandID,
00042         MoNetCommandInfo*, less<MoNetCommandID> >::iterator iter;
00043 
00044     iter = infoMap.find(commandID);
00045     if (iter != infoMap.end()) {
00046         return (*iter).second;
00047     } else {
00048         return 0;
00049     }
00050 }
00051 

Generated on Sun Dec 2 23:04:29 2007 for openSDK by  doxygen 1.3.9.1