File: db_writer_factory.h

package info (click to toggle)
kmc 3.2.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,716 kB
  • sloc: cpp: 38,308; python: 664; makefile: 216; perl: 179; sh: 34
file content (25 lines) | stat: -rw-r--r-- 594 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef _DB_WRITER_FACTORY_H
#define _DB_WRITER_FACTORY_H

#include "kmc1_db_writer.h"
#include "kff_db_writer.h"

template<unsigned SIZE>
CDbWriter<SIZE>* db_writer_factory(COutputDesc& output_desc, CBundle<SIZE>* bundle = nullptr)
{
	switch (output_desc.output_type)
	{
		case OutputType::KMC1:
			return new CKMC1DbWriter<SIZE>(bundle, output_desc);
		case OutputType::KFF1:
			return new CKFFDbWriter<SIZE>(bundle, output_desc);
		default:
		{
			std::cerr << "Error: this should never happen, please contact authors: " << __FILE__ << "\t" << __LINE__ << "\n";
			exit(1);
		}
	}
}


#endif