CppCMS
cppcms/base_view.h
00001 
00002 //                                                                             
00003 //  Copyright (C) 2008-2012  Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>     
00004 //                                                                             
00005 //  See accompanying file COPYING.TXT file for licensing details.
00006 //
00008 #ifndef CPPCMS_BASE_VIEW_H
00009 #define CPPCMS_BASE_VIEW_H
00010 
00011 #include <cppcms/defs.h>
00012 
00013 #include <ostream>
00014 #include <sstream>
00015 #include <string>
00016 #include <map>
00017 #include <ctime>
00018 #include <memory>
00019 
00020 #include <booster/hold_ptr.h>
00021 #include <cppcms/base_content.h>
00022 #include <booster/noncopyable.h>
00023 #include <cppcms/config.h>
00024 
00025 namespace cppcms {
00026 
00034 
00035 class CPPCMS_API base_view : booster::noncopyable {
00036 public:
00040         virtual void render();
00041         virtual ~base_view();
00042         
00043 
00044 protected:
00045 
00047 
00048         base_view(std::ostream &out);
00049         std::ostream &out();
00050 
00052 
00053 private:
00054         struct _data;
00055         booster::hold_ptr<_data> d;
00056 
00057 };
00058 
00059 } // cppcms
00060 
00061 
00062 #if defined __clang__
00063 #       if __has_feature(cxx_auto_type)
00064 #               define CPPCMS_HAVE_AUTO_TYPE
00065 #       endif
00066 #elif defined __GNUC__
00067 #       if (__GNUC__ >= 4 || (__GNUC__ == 4 &&  __GNUC_MINOR__ >= 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
00068 #               define CPPCMS_HAVE_AUTO_TYPE
00069 #       endif
00070 #elif defined _MSC_VER
00071 #       if _MSC_VER >= 1600
00072 #               define CPPCMS_HAVE_AUTO_TYPE
00073 #       endif
00074 #elif defined __INTEL_COMPILER
00075 #       if __INTEL_COMPILER >= 1200 && defined(__GXX_EXPERIMENTAL_CXX0X__)
00076 #               define CPPCMS_HAVE_AUTO_TYPE
00077 #       endif
00078 #elif defined CPPCMS_HAVE_CPP_0X_AUTO // detected at compilation stage
00079 #       define CPPCMS_HAVE_AUTO_TYPE
00080 #endif
00081 
00082 
00083 #if defined(CPPCMS_HAVE_AUTO_TYPE)
00084 #       define CPPCMS_TYPEOF(x) auto
00085 #elif defined(CPPCMS_HAVE_CPP_0X_DECLTYPE)
00086 #       define CPPCMS_TYPEOF(x) decltype(x)
00087 #elif defined(CPPCMS_HAVE_GCC_TYPEOF)
00088 #       define CPPCMS_TYPEOF(x) typeof(x)
00089 #elif defined(CPPCMS_HAVE_UNDERSCORE_TYPEOF)
00090 #       define CPPCMS_TYPEOF(x) __typeof__(x)
00091 #else
00092 #       define CPPCMS_TYPEOF(x) automatic_type_identification_is_not_supported_by_this_compiler
00093 #endif
00094 
00095 
00096 #endif