GME  13
CommonMgaTrukk.h
Go to the documentation of this file.
00001 
00002 #ifndef MGA_COMMONMGATRUKK_H
00003 #define MGA_COMMONMGATRUKK_H
00004 
00005 #include <memory>
00006 
00007 #define MGACOLL_ITERATE(iftype, collifptr) \
00008 { \
00009         ASSERT( collifptr != NULL ); \
00010         long iter_count = 0; \
00011         COMTHROW( collifptr->get_Count(&iter_count) ); \
00012         ASSERT( iter_count >= 0 ); \
00013         std::unique_ptr<CComPtr<iftype>[]> array(new CComPtr<iftype>[iter_count]); \
00014         CComPtr<iftype> *arrptr, *arrend; \
00015         if(iter_count > 0) \
00016                 COMTHROW( collifptr->GetAll(iter_count, &(*array.get())) ); \
00017         arrend = array.get()+iter_count; \
00018         for(arrptr = array.get(); arrptr != arrend; arrptr++)
00019 
00020 #define MGACOLL_ITER (*arrptr)
00021 
00022 #define MGACOLL_AT_END (arrptr == arrend)
00023 
00024 #define MGACOLL_ITERATE_END }
00025 
00026 #endif//MGA_COMMONMGATRUKK_H
00027