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
|
|
|
|
{
|
|
|
|
SSL_Template()
|
|
|
|
{
|
|
|
|
canLoadStream = stream;
|
|
|
|
canLoadFile = file;
|
|
|
|
}
|
|
|
|
|
|
|
|
SampleSource *load(const std::string &file)
|
|
|
|
{
|
|
|
|
assert(canLoadFile);
|
2009-12-29 10:56:14 +00:00
|
|
|
return new SourceT(file);
|
2009-12-28 16:15:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SampleSource *load(Stream::Stream *input)
|
|
|
|
{
|
|
|
|
assert(canLoadStream);
|
2009-12-29 10:56:14 +00:00
|
|
|
return new SourceT(input);
|
2009-12-28 16:15:52 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|