ChipMaster's trial hacks on C++CMS starting with v1.2.1. Not sure I'll follow on with the v2 since it looks to be breaking and mostly frivolous.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

97 lines
2.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
  4. //
  5. // See accompanying file COPYING.TXT file for licensing details.
  6. //
  7. ///////////////////////////////////////////////////////////////////////////////
  8. #ifndef CPPCMS_BASE_VIEW_H
  9. #define CPPCMS_BASE_VIEW_H
  10. #include <cppcms/defs.h>
  11. #include <ostream>
  12. #include <sstream>
  13. #include <string>
  14. #include <map>
  15. #include <ctime>
  16. #include <booster/auto_ptr_inc.h>
  17. #include <booster/hold_ptr.h>
  18. #include <cppcms/base_content.h>
  19. #include <booster/noncopyable.h>
  20. #include <cppcms/config.h>
  21. namespace cppcms {
  22. ///
  23. /// \brief This class is base class for all views (skins) rendered by CppCMS template engine.
  24. ///
  25. /// Users are not expected to derive from this class or use it directly. CppCMS template compiler
  26. /// create skins that are usable with template engine and each template is derived from the \a base_view
  27. /// class.
  28. ///
  29. class CPPCMS_API base_view : booster::noncopyable {
  30. public:
  31. ///
  32. /// The main rendering function -- render the main HTML page. It is usually overridden in template engine.
  33. ///
  34. virtual void render();
  35. virtual ~base_view();
  36. protected:
  37. /// \cond INTERNAL
  38. base_view(std::ostream &out);
  39. std::ostream &out();
  40. /// \endcond
  41. private:
  42. struct _data;
  43. booster::hold_ptr<_data> d;
  44. };
  45. } // cppcms
  46. #if defined __clang__
  47. # if __has_feature(cxx_auto_type)
  48. # define CPPCMS_HAVE_AUTO_TYPE
  49. # endif
  50. #elif defined __GNUC__
  51. # if (__GNUC__ >= 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
  52. # define CPPCMS_HAVE_AUTO_TYPE
  53. # endif
  54. #elif defined _MSC_VER
  55. # if _MSC_VER >= 1600
  56. # define CPPCMS_HAVE_AUTO_TYPE
  57. # endif
  58. #elif defined __INTEL_COMPILER
  59. # if __INTEL_COMPILER >= 1200 && defined(__GXX_EXPERIMENTAL_CXX0X__)
  60. # define CPPCMS_HAVE_AUTO_TYPE
  61. # endif
  62. #elif defined CPPCMS_HAVE_CPP_0X_AUTO // detected at compilation stage
  63. # define CPPCMS_HAVE_AUTO_TYPE
  64. #endif
  65. #if defined(CPPCMS_HAVE_AUTO_TYPE)
  66. # define CPPCMS_TYPEOF(x) auto
  67. #elif defined(CPPCMS_HAVE_CPP_0X_DECLTYPE)
  68. # define CPPCMS_TYPEOF(x) decltype(x)
  69. #elif defined(CPPCMS_HAVE_GCC_TYPEOF)
  70. # define CPPCMS_TYPEOF(x) typeof(x)
  71. #elif defined(CPPCMS_HAVE_UNDERSCORE_TYPEOF)
  72. # define CPPCMS_TYPEOF(x) __typeof__(x)
  73. #else
  74. # define CPPCMS_TYPEOF(x) automatic_type_identification_is_not_supported_by_this_compiler
  75. #endif
  76. #endif