summaryrefslogtreecommitdiff
path: root/simple.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-16 01:53:45 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-16 01:53:45 +0000
commit42c3d8f3aa593c224174558fd6f3d2709e08f7d0 (patch)
tree1f90c9ea7a31679b5c416408a3ffeba23e87d165 /simple.h
parent09326fa9f564c09ebecff7c56d0e33555dec65b6 (diff)
downloadcryptopp-42c3d8f3aa593c224174558fd6f3d2709e08f7d0.tar.gz
added support for using encoding parameters and key derivation parameters
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@98 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'simple.h')
-rw-r--r--simple.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/simple.h b/simple.h
index 0185a26..6a71b17 100644
--- a/simple.h
+++ b/simple.h
@@ -109,29 +109,38 @@ protected:
};
template <class T>
-class CRYPTOPP_NO_VTABLE CustomSignalPropagation : public T
+class CRYPTOPP_NO_VTABLE CustomFlushPropagation : public T
+{
+public:
+ CustomFlushPropagation() {}
+ CustomFlushPropagation(BufferedTransformation *q) : T(q) {}
+
+ virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) =0;
+
+private:
+ bool IsolatedFlush(bool hardFlush, bool blocking) {assert(false); return false;}
+};
+
+template <class T>
+class CRYPTOPP_NO_VTABLE CustomSignalPropagation : public CustomFlushPropagation<T>
{
public:
CustomSignalPropagation() {}
- CustomSignalPropagation(BufferedTransformation *q) : T(q) {}
+ CustomSignalPropagation(BufferedTransformation *q) : CustomFlushPropagation<T>(q) {}
virtual void Initialize(const NameValuePairs &parameters=g_nullNameValuePairs, int propagation=-1) =0;
- virtual bool Flush(bool hardFlush, int propagation=-1, bool blocking=true) =0;
private:
void IsolatedInitialize(const NameValuePairs &parameters) {assert(false);}
- bool IsolatedFlush(bool hardFlush, bool blocking) {assert(false); return false;}
};
template <class T>
-class CRYPTOPP_NO_VTABLE Multichannel : public CustomSignalPropagation<T>
+class CRYPTOPP_NO_VTABLE Multichannel : public CustomFlushPropagation<T>
{
public:
Multichannel() {}
- Multichannel(BufferedTransformation *q) : CustomSignalPropagation<T>(q) {}
+ Multichannel(BufferedTransformation *q) : CustomFlushPropagation<T>(q) {}
- void Initialize(const NameValuePairs &parameters, int propagation)
- {ChannelInitialize(NULL_CHANNEL, parameters, propagation);}
bool Flush(bool hardFlush, int propagation=-1, bool blocking=true)
{return ChannelFlush(NULL_CHANNEL, hardFlush, propagation, blocking);}
bool MessageSeriesEnd(int propagation=-1, bool blocking=true)
@@ -154,7 +163,6 @@ public:
unsigned int ChannelPutModifiable2(const std::string &channel, byte *begin, unsigned int length, int messageEnd, bool blocking)
{return ChannelPut2(channel, begin, length, messageEnd, blocking);}
- virtual void ChannelInitialize(const std::string &channel, const NameValuePairs &parameters=g_nullNameValuePairs, int propagation=-1) =0;
virtual bool ChannelFlush(const std::string &channel, bool hardFlush, int propagation=-1, bool blocking=true) =0;
};