-
Notifications
You must be signed in to change notification settings - Fork 12
/
makeprocessor.sh
executable file
·55 lines (38 loc) · 949 Bytes
/
makeprocessor.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash
if [[ $@ =~ "--help" ]] || [[ $# < 2 ]]
then
echo "Usage : makeprocessor.sh PrefixProcessor SubFolder"
exit 1
fi
lower=${1,,}
upper=${1^^}
folder=processor/${2,,}
if [ ! -d "$folder" ]; then
mkdir $folder
fi
licence=`cat licence`
############################### HEADER ###############################
echo "$licence
#pragma once
#include \"processor/abstractprocessor.h\"
class ${1}Processor : public AbstractProcessor
{
public:
${1}Processor();
protected:
virtual Properties processImpl(const Properties &inputs) override;
};
" > $folder/${lower}processor.h
################################# CPP ################################
echo "$licence
#include \"${lower}processor.h\"
#include \"global/cvutils.h\"
${1}Processor::${1}Processor()
{
}
Properties ${1}Processor::processImpl(const Properties &inputs)
{
Properties outputs;
return outputs;
}
" > $folder/${lower}processor.cpp