/*
- * Copyright 2001-2006 Internet2
+ * Copyright 2001-2010 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Helper class on top of StorageService for detecting message replay.
*/
-#ifndef __xmltooling_replay_h__
+#if !defined(__xmltooling_replay_h__) && !defined(XMLTOOLING_LITE)
#define __xmltooling_replay_h__
-#include <xmltooling/util/StorageService.h>
+#include <xmltooling/base.h>
namespace xmltooling {
+ class XMLTOOL_API StorageService;
+
/**
* Helper class on top of StorageService for detecting message replay.
*/
class XMLTOOL_API ReplayCache
{
- MAKE_NONCOPYABLE(ReplayCache);
+ MAKE_NONCOPYABLE(ReplayCache);
public:
/**
* The lifetime of the StorageService <strong>MUST</strong> be longer than
* the lifetime of the ReplayCache.
*
- * @param storage pointer to a StorageService, or NULL to keep cache in memory
+ * @param storage pointer to a StorageService, or nullptr to keep cache in memory
*/
- ReplayCache(StorageService* storage=NULL);
+ ReplayCache(StorageService* storage=nullptr);
virtual ~ReplayCache();
*/
virtual bool check(const char* context, const char* s, time_t expires);
- bool check(const char* context, const XMLCh* str, time_t expires) {
- auto_ptr_char temp(str);
- return check(context, temp.get(), expires);
- }
+ /**
+ * Returns true iff the check value is not found in the cache, and stores it.
+ *
+ * @param context a context label to subdivide the cache
+ * @param s value to check
+ * @param expires time for disposal of value from cache
+ */
+ bool check(const char* context, const XMLCh* s, time_t expires);
private:
bool m_owned;