|
Video Processing Framework
|
00001 #ifndef STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00002 #define STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 00003 00004 #if !defined(__GNUC__) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4) // GCC supports "pragma once" correctly since 3.4 00005 #pragma once 00006 #endif 00007 00008 00009 #include <vector> 00010 #include <list> 00011 #include <map> 00012 00013 namespace YAML 00014 { 00015 template <typename T> 00016 inline Emitter& operator << (Emitter& emitter, const std::vector <T>& v) { 00017 typedef typename std::vector <T> vec; 00018 emitter << BeginSeq; 00019 for(typename vec::const_iterator it=v.begin();it!=v.end();++it) 00020 emitter << *it; 00021 emitter << EndSeq; 00022 return emitter; 00023 } 00024 00025 template <typename T> 00026 inline Emitter& operator << (Emitter& emitter, const std::list <T>& v) { 00027 typedef typename std::list <T> list; 00028 emitter << BeginSeq; 00029 for(typename list::const_iterator it=v.begin();it!=v.end();++it) 00030 emitter << *it; 00031 emitter << EndSeq; 00032 return emitter; 00033 } 00034 00035 template <typename K, typename V> 00036 inline Emitter& operator << (Emitter& emitter, const std::map <K, V>& m) { 00037 typedef typename std::map <K, V> map; 00038 emitter << BeginMap; 00039 for(typename map::const_iterator it=m.begin();it!=m.end();++it) 00040 emitter << Key << it->first << Value << it->second; 00041 emitter << EndMap; 00042 return emitter; 00043 } 00044 } 00045 00046 #endif // STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66