epoc-cellid.hpp

Go to the documentation of this file.
00001 #ifndef __epoc_cellid_hpp__
00002 #define __epoc_cellid_hpp__
00003 
00004 #include "application_config.h"
00005 
00006 #if __CELLID_ENABLED__
00007 
00008 #include "ac_app_context.h"
00009 #include "ld_log_db.h"
00010 #include "utils_cl2.h"
00011 
00012 #include <e32base.h>
00013 #include <etel3rdparty.h>
00014 
00015 #include <glib.h>
00016 
00017 /***koog 
00018 (require codegen/symbian-cxx)
00019 (ctor-defines/spec
00020  "CSensor_cellid" ;; name
00021  "ac_AppContext* aAppContext" ;; args
00022  "iAppContext(aAppContext)" ;; inits
00023  "" ;; ctor
00024  #t ;; ConstructL
00025 )
00026  ***/
00027 #define CTOR_DECL_CSensor_cellid  \
00028 public: static CSensor_cellid* NewLC(ac_AppContext* aAppContext); \
00029 public: static CSensor_cellid* NewL(ac_AppContext* aAppContext); \
00030 private: CSensor_cellid(ac_AppContext* aAppContext); \
00031 private: void ConstructL();
00032 
00033 #define CTOR_IMPL_CSensor_cellid  \
00034 CSensor_cellid* CSensor_cellid::NewLC(ac_AppContext* aAppContext) \
00035 { \
00036   CSensor_cellid* obj = new (ELeave) CSensor_cellid(aAppContext); \
00037   CleanupStack::PushL(obj); \
00038   obj->ConstructL(); \
00039   return obj; \
00040 } \
00041  \
00042 CSensor_cellid* CSensor_cellid::NewL(ac_AppContext* aAppContext) \
00043 { \
00044   CSensor_cellid* obj = CSensor_cellid::NewLC(aAppContext); \
00045   CleanupStack::Pop(obj); \
00046   return obj; \
00047 } \
00048  \
00049 CSensor_cellid::CSensor_cellid(ac_AppContext* aAppContext) : iAppContext(aAppContext) \
00050 {}
00051 /***end***/
00052 
00053 NONSHARABLE_CLASS(CSensor_cellid) :
00054   public CBase
00055 {
00056   // We do not increment the refcount of the LogDb object, and the
00057   // framework is responsible for ensuring that the LogDb instance
00058   // stays alive for at least as long as this sensor object.
00059   CTOR_DECL_CSensor_cellid;
00060 
00061  public:
00062   virtual ~CSensor_cellid();
00063 
00064   void PostNewData(const CTelephony::TNetworkInfoV1& aData);
00065 
00066  private:
00067   // Leaves on OOM or logging error.
00068   void PostNewDataL(const CTelephony::TNetworkInfoV1& aData);
00069 
00070   void Unregister();
00071 
00072  private:
00073   ac_AppContext* iAppContext; // not owned
00074 
00075   bb_Closure iClosure;
00076 
00077   CTelephony::TNetworkInfoV1 iOldData;
00078 
00079  private:
00080   LogDb* GetLogDb() const { return ac_LogDb(iAppContext); }
00081 
00082   bb_Blackboard* GetBlackboard() const { return ac_get_Blackboard(iAppContext); }
00083 };
00084 
00085 #endif // __CELLID_ENABLED__
00086 
00087 // --------------------------------------------------
00088 // sensor array integration
00089 // --------------------------------------------------
00090 
00091 #if defined(SA_ARRAY_INTEGRATION)
00092 #if __CELLID_ENABLED__
00093 #define DECLARE_SENSOR_cellid CSensor_cellid* iSensor_cellid
00094 #define SENSOR_CELLID_DESTROY DELETE_Z(self->iSensor_cellid)
00095 #define SENSOR_CELLID_CREATE 
00096 #define SENSOR_CELLID_START sa_typical_symbian_sensor_create(self->iSensor_cellid = CSensor_cellid::NewL(self->ac), "cellid sensor initialization")
00097 #define SENSOR_CELLID_STOP SENSOR_CELLID_DESTROY
00098 #define SENSOR_CELLID_IS_RUNNING (self->iSensor_cellid != NULL)
00099 #define SENSOR_CELLID_RECONFIGURE(key, value) sa_reconfigure_ignore_all_keys
00100 #else
00101 #define DECLARE_SENSOR_cellid
00102 #endif
00103 #endif /* SA_ARRAY_INTEGRATION */
00104 
00105 #endif /* __epoc_cellid_hpp__ */
00106 
00107 /**
00108 
00109 epoc-cellid.hpp
00110 
00111 Copyright 2009 Helsinki Institute for Information Technology (HIIT)
00112 and the authors. All rights reserved.
00113 
00114 Authors: Tero Hasu <tero.hasu@hut.fi>
00115 
00116 Permission is hereby granted, free of charge, to any person
00117 obtaining a copy of this software and associated documentation files
00118 (the "Software"), to deal in the Software without restriction,
00119 including without limitation the rights to use, copy, modify, merge,
00120 publish, distribute, sublicense, and/or sell copies of the Software,
00121 and to permit persons to whom the Software is furnished to do so,
00122 subject to the following conditions:
00123 
00124 The above copyright notice and this permission notice shall be
00125 included in all copies or substantial portions of the Software.
00126 
00127 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00128 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00129 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00130 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00131 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00132 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00133 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00134 SOFTWARE.
00135 
00136  **/

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:52 2011 by Doxygen 1.6.1