2009-12-28 16:15:52 +00:00
|
|
|
#ifndef SSL_TEMPL_H
|
|
|
|
#define SSL_TEMPL_H
|
|
|
|
|
2009-12-29 10:56:14 +00:00
|
|
|
template <class SourceT, bool stream, bool file>
|
2009-12-28 16:15:52 +00:00
|
|
|
class SSL_Template : public SampleSourceLoader
|
|
|
|
{
|
2010-01-01 17:42:35 +00:00
|
|
|
public:
|
|
|
|
|
2009-12-28 16:15:52 +00:00
|
|
|
SSL_Template()
|
|
|
|
{
|
|
|
|
canLoadStream = stream;
|
|
|
|
canLoadFile = file;
|
|
|
|
}
|
|
|
|
|
2010-01-01 17:42:35 +00:00
|
|
|
SampleSourcePtr load(const std::string &filename)
|
2009-12-28 16:15:52 +00:00
|
|
|
{
|
|
|
|
assert(canLoadFile);
|
2010-01-01 17:42:35 +00:00
|
|
|
return SampleSourcePtr(new SourceT(filename));
|
2009-12-28 16:15:52 +00:00
|
|
|
}
|
|
|
|
|
2010-01-01 17:42:35 +00:00
|
|
|
SampleSourcePtr load(Stream::StreamPtr input)
|
2009-12-28 16:15:52 +00:00
|
|
|
{
|
|
|
|
assert(canLoadStream);
|
2010-01-01 17:42:35 +00:00
|
|
|
return SampleSourcePtr(new SourceT(input));
|
2009-12-28 16:15:52 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|