You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2010/11/20 16:18:25 UTC
svn commit: r1037240 -
/trafficserver/traffic/branches/wccp/proxy/api/ts/TsException.h
Author: amc
Date: Sat Nov 20 15:18:24 2010
New Revision: 1037240
URL: http://svn.apache.org/viewvc?rev=1037240&view=rev
Log:
Adding missing file.
Added:
trafficserver/traffic/branches/wccp/proxy/api/ts/TsException.h
Added: trafficserver/traffic/branches/wccp/proxy/api/ts/TsException.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/branches/wccp/proxy/api/ts/TsException.h?rev=1037240&view=auto
==============================================================================
--- trafficserver/traffic/branches/wccp/proxy/api/ts/TsException.h (added)
+++ trafficserver/traffic/branches/wccp/proxy/api/ts/TsException.h Sat Nov 20 15:18:24 2010
@@ -0,0 +1,38 @@
+# if ! defined(TS_EXCEPTION_HEADER)
+# define TS_EXCEPTION_HEADER
+
+/** @file
+ Apach Traffic Server Exceptions.
+ */
+
+# include <stddef.h>
+# include <unistd.h>
+
+namespace ts {
+ /** Base class for ATS exception.
+ Clients should subclass as appropriate. This is intended to carry
+ pre-allocated text along so that it can be thrown without any
+ addditional memory allocation.
+ */
+ class Exception {
+ public:
+ /// Default constructor.
+ Exception();
+ /// Construct with alternate @a text.
+ Exception(
+ const char* text ///< Alternate text for exception.
+ );
+
+ static char const* const DEFAULT_TEXT;
+ protected:
+ char const* m_text;
+ };
+
+ // ----------------------------------------------------------
+ // Inline implementations.
+
+ inline Exception::Exception() : m_text(DEFAULT_TEXT) { }
+ inline Exception::Exception(char const* text) : m_text(text) { }
+}
+
+# endif // TS_EXCEPTION_HEADER