shared library with pure abstract class (interface) v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 21 Jul 2018 17:30:46 +0200
branchv_0
changeset 1 7e43750deca8
parent 0 3dd6adb7e191
child 2 2ee70261bd9b
shared library with pure abstract class (interface)
nbproject/Makefile-Debug.mk
nbproject/Makefile-Release.mk
nbproject/configurations.xml
relpipe-in-cli.cpp
--- a/nbproject/Makefile-Debug.mk	Sun Jul 08 15:36:28 2018 +0200
+++ b/nbproject/Makefile-Debug.mk	Sat Jul 21 17:30:46 2018 +0200
@@ -35,7 +35,7 @@
 
 # Object Files
 OBJECTFILES= \
-	${OBJECTDIR}/relpipe-in-cli.cpp.o
+	${OBJECTDIR}/relpipe-in-cli.o
 
 
 # C Compiler Flags
@@ -52,7 +52,7 @@
 ASFLAGS=
 
 # Link Libraries and Options
-LDLIBSOPTIONS=
+LDLIBSOPTIONS=`pkg-config --libs relpipe-lib-writer.cpp`  
 
 # Build Targets
 .build-conf: ${BUILD_SUBPROJECTS}
@@ -62,10 +62,10 @@
 	${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
 	${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/relpipe-in-cli.cpp ${OBJECTFILES} ${LDLIBSOPTIONS}
 
-${OBJECTDIR}/relpipe-in-cli.cpp.o: relpipe-in-cli.cpp.cpp
+${OBJECTDIR}/relpipe-in-cli.o: relpipe-in-cli.cpp
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} "$@.d"
-	$(COMPILE.cc) -g -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/relpipe-in-cli.cpp.o relpipe-in-cli.cpp.cpp
+	$(COMPILE.cc) -g `pkg-config --cflags relpipe-lib-writer.cpp` -std=c++14  -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/relpipe-in-cli.o relpipe-in-cli.cpp
 
 # Subprojects
 .build-subprojects:
--- a/nbproject/Makefile-Release.mk	Sun Jul 08 15:36:28 2018 +0200
+++ b/nbproject/Makefile-Release.mk	Sat Jul 21 17:30:46 2018 +0200
@@ -35,7 +35,7 @@
 
 # Object Files
 OBJECTFILES= \
-	${OBJECTDIR}/relpipe-in-cli.cpp.o
+	${OBJECTDIR}/relpipe-in-cli.o
 
 
 # C Compiler Flags
@@ -52,7 +52,7 @@
 ASFLAGS=
 
 # Link Libraries and Options
-LDLIBSOPTIONS=
+LDLIBSOPTIONS=`pkg-config --libs relpipe-lib-writer.cpp`  
 
 # Build Targets
 .build-conf: ${BUILD_SUBPROJECTS}
@@ -62,10 +62,10 @@
 	${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
 	${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/relpipe-in-cli.cpp ${OBJECTFILES} ${LDLIBSOPTIONS}
 
-${OBJECTDIR}/relpipe-in-cli.cpp.o: relpipe-in-cli.cpp.cpp
+${OBJECTDIR}/relpipe-in-cli.o: relpipe-in-cli.cpp
 	${MKDIR} -p ${OBJECTDIR}
 	${RM} "$@.d"
-	$(COMPILE.cc) -O2 -std=c++14 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/relpipe-in-cli.cpp.o relpipe-in-cli.cpp.cpp
+	$(COMPILE.cc) -O2 `pkg-config --cflags relpipe-lib-writer.cpp` -std=c++14  -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/relpipe-in-cli.o relpipe-in-cli.cpp
 
 # Subprojects
 .build-subprojects:
--- a/nbproject/configurations.xml	Sun Jul 08 15:36:28 2018 +0200
+++ b/nbproject/configurations.xml	Sat Jul 21 17:30:46 2018 +0200
@@ -12,7 +12,7 @@
     <logicalFolder name="SourceFiles"
                    displayName="Source Files"
                    projectFiles="true">
-      <itemPath>relpipe-in-cli.cpp.cpp</itemPath>
+      <itemPath>relpipe-in-cli.cpp</itemPath>
     </logicalFolder>
     <logicalFolder name="TestFiles"
                    displayName="Test Files"
@@ -35,11 +35,22 @@
         <rebuildPropChanged>false</rebuildPropChanged>
       </toolsSet>
       <compileType>
+        <cTool>
+          <incFile>
+            <pElem>../../src/relpipe-lib-writer.cpp/DataTypeWriter.h</pElem>
+            <pElem>../../src/relpipe-lib-writer.cpp/DataTypeWriterBase.h</pElem>
+          </incFile>
+        </cTool>
         <ccTool>
           <standard>11</standard>
         </ccTool>
+        <linkerTool>
+          <linkerLibItems>
+            <linkerOptionItem>`pkg-config --libs relpipe-lib-writer.cpp`</linkerOptionItem>
+          </linkerLibItems>
+        </linkerTool>
       </compileType>
-      <item path="relpipe-in-cli.cpp.cpp" ex="false" tool="1" flavor2="0">
+      <item path="relpipe-in-cli.cpp" ex="false" tool="1" flavor2="0">
       </item>
     </conf>
     <conf name="Release" type="1">
@@ -62,8 +73,13 @@
         <asmTool>
           <developmentMode>5</developmentMode>
         </asmTool>
+        <linkerTool>
+          <linkerLibItems>
+            <linkerOptionItem>`pkg-config --libs relpipe-lib-writer.cpp`</linkerOptionItem>
+          </linkerLibItems>
+        </linkerTool>
       </compileType>
-      <item path="relpipe-in-cli.cpp.cpp" ex="false" tool="1" flavor2="0">
+      <item path="relpipe-in-cli.cpp" ex="false" tool="1" flavor2="0">
       </item>
     </conf>
   </confs>
--- a/relpipe-in-cli.cpp	Sun Jul 08 15:36:28 2018 +0200
+++ b/relpipe-in-cli.cpp	Sat Jul 21 17:30:46 2018 +0200
@@ -1,9 +1,17 @@
 #include <cstdlib>
+#include <memory>
 
-using namespace std;
+#include <RelationalWriter.h>
 
 int main(int argc, char** argv) {
+	std::unique_ptr<relpipe::writer::RelationalWriter> writer(relpipe::writer::RelationalWriter::create(std::cout));
 
-	return 0;
+	if (writer.get() == nullptr) {
+		std::cout << "writer.get() == nullptr" << std::endl;
+	} else {
+		writer->startRelation({}, true);
+		writer->writeRecord({});
+		return 0;
+	}
 }