From f404903fe53854bd3e06bd3a4aec2031f1b77632 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Thu, 22 Jan 2015 07:53:40 +0000 Subject: [PATCH] - added FsmEval git-svn-id: http://moon:8086/svn/software/trunk/projects/FsmEval@130 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- AState.hpp | 40 +++++ AStateMachine.hpp | 56 +++++++ IStateMachine.hpp | 29 ++++ main.cpp | 206 ++++++++++++++++++++++++ nbproject/Makefile-Debug.mk | 84 ++++++++++ nbproject/Makefile-Release.mk | 84 ++++++++++ nbproject/Makefile-impl.mk | 133 +++++++++++++++ nbproject/Makefile-variables.mk | 35 ++++ nbproject/Package-Debug.bash | 76 +++++++++ nbproject/Package-Release.bash | 76 +++++++++ nbproject/configurations.xml | 81 ++++++++++ nbproject/private/Makefile-variables.mk | 7 + nbproject/private/configurations.xml | 75 +++++++++ nbproject/private/launcher.properties | 40 +++++ nbproject/private/private.xml | 11 ++ nbproject/project.xml | 28 ++++ 16 files changed, 1061 insertions(+) create mode 100644 AState.hpp create mode 100644 AStateMachine.hpp create mode 100644 IStateMachine.hpp create mode 100644 main.cpp create mode 100644 nbproject/Makefile-Debug.mk create mode 100644 nbproject/Makefile-Release.mk create mode 100644 nbproject/Makefile-impl.mk create mode 100644 nbproject/Makefile-variables.mk create mode 100644 nbproject/Package-Debug.bash create mode 100644 nbproject/Package-Release.bash create mode 100644 nbproject/configurations.xml create mode 100644 nbproject/private/Makefile-variables.mk create mode 100644 nbproject/private/configurations.xml create mode 100644 nbproject/private/launcher.properties create mode 100644 nbproject/private/private.xml create mode 100644 nbproject/project.xml diff --git a/AState.hpp b/AState.hpp new file mode 100644 index 0000000..d109163 --- /dev/null +++ b/AState.hpp @@ -0,0 +1,40 @@ +/* + * File: AState.hpp + * Author: jens + * + * Created on 21. Januar 2015, 05:12 + */ + +#ifndef ASTATE_HPP +#define ASTATE_HPP + +#include "IStateMachine.hpp" + +class AState +{ +public: + AState() + : m_pStateMachine(0) + { + } + virtual ~AState() {} + + void registerStateMachine(IStateMachine *pStateMachine) + { + m_pStateMachine = pStateMachine; + } + +protected: + void setState(IStateMachine::StateId state) + { + if(m_pStateMachine) + { + m_pStateMachine->setState(state); + } + } +private: + IStateMachine *m_pStateMachine; +}; + +#endif /* ASTATE_HPP */ + diff --git a/AStateMachine.hpp b/AStateMachine.hpp new file mode 100644 index 0000000..5582fd0 --- /dev/null +++ b/AStateMachine.hpp @@ -0,0 +1,56 @@ +/* + * File: AStateMachine.hpp + * Author: jens + * + * Created on 21. Januar 2015, 05:20 + */ + +#ifndef ASTATEMACHINE_HPP +#define ASTATEMACHINE_HPP + +#include "IStateMachine.hpp" +#include "AState.hpp" + +class AStateMachine : public IStateMachine +{ +public: + + AStateMachine() + : m_stateCurr(NUM_STATES) + , m_stateNext(INIT) + { + } + + virtual ~AStateMachine() + { + } + + void add(StateId stateId, AState *pState) + { + pState->registerStateMachine(this); + m_states[stateId] = pState; + } + + void setState(StateId stateId) + { + m_stateNext = stateId; + } + + bool transition() + { + bool isTransition = (m_stateNext != m_stateCurr); + + m_stateCurr = m_stateNext; + + return isTransition; + } +protected: + StateId m_stateCurr; + StateId m_stateNext; + AState *m_states[NUM_STATES]; + +}; + + +#endif /* ASTATEMACHINE_HPP */ + diff --git a/IStateMachine.hpp b/IStateMachine.hpp new file mode 100644 index 0000000..5d98872 --- /dev/null +++ b/IStateMachine.hpp @@ -0,0 +1,29 @@ +/* + * File: IStateMachine.hpp + * Author: jens + * + * Created on 22. Januar 2015, 08:39 + */ + +#ifndef ISTATEMACHINE_HPP +#define ISTATEMACHINE_HPP + +class IStateMachine +{ +public: + enum StateId + { + INIT=0, + IDLE, + ACTIVE_0, + ACTIVE_1, + NUM_STATES + }; + IStateMachine() {} + ~IStateMachine() {} + + virtual void setState(StateId stateId) = 0; +}; + +#endif /* ISTATEMACHINE_HPP */ + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..6d4cdbd --- /dev/null +++ b/main.cpp @@ -0,0 +1,206 @@ +/* + * File: main.cpp + * Author: jens + * + * Created on 21. Januar 2015, 05:05 + */ + +#include +#include + +#include "AState.hpp" +#include "AStateMachine.hpp" + +using namespace std; + +/* + * + */ + +class Context +{ +public: + Context() + : m_count(0) + { + + } + + ~Context() {} + + int m_count; + +}; +class IState +{ +public: + IState() + { + + } + + virtual ~IState() + { + + } + + virtual void onTransition(int x) + { + printf("%s() x=%d\n", __PRETTY_FUNCTION__, x); + } + + virtual void process(int x) + { + printf("%s() x=%d\n", __PRETTY_FUNCTION__, x); + } + +}; + +class StateMachine : public AStateMachine +{ +public: + + StateMachine() + : AStateMachine() + { + } + + ~StateMachine() + { + } + + void process(int x) + { + if(transition()) + { + dynamic_cast(m_states[m_stateCurr])->onTransition(x); + } + dynamic_cast(m_states[m_stateCurr])->process(x); + } + +}; + +class StateInit : public AState, public IState +{ +public: + StateInit(Context &context) + : m_context(context) + { + + } + + ~StateInit() {} + + void process(int x) + { + printf("%s() x=%d\n", __PRETTY_FUNCTION__, x); + setState(IStateMachine::IDLE); + } + +private: + Context &m_context; +}; + +class StateIdle : public AState, public IState +{ +public: + StateIdle(Context &context) + : m_context(context) + { + + } + + ~StateIdle() {} + + void onTransition(int x) + { + printf("%s() x=%d\n", __PRETTY_FUNCTION__, x); + m_context.m_count = 0; + } + + void process(int x) + { + printf("%s() x=%d\n", __PRETTY_FUNCTION__, x); + if (x >= 10) + { + setState(IStateMachine::ACTIVE_0); + } + } + +private: + Context &m_context; +}; + +class StateActive0 : public AState, public IState +{ +public: + StateActive0(Context &context) + : m_context(context) + { + + } + + ~StateActive0() {} + + void process(int x) + { + printf("%s() x=%d\n", __PRETTY_FUNCTION__, x); + + m_context.m_count++; + if (m_context.m_count == 10) + { + setState(IStateMachine::ACTIVE_1); + } + } + +private: + Context &m_context; +}; + +class StateActive1 : public AState, public IState +{ +public: + StateActive1(Context &context) + : m_context(context) + { + + } + + ~StateActive1() {} + + void process(int x) + { + printf("%s() x=%d\n", __PRETTY_FUNCTION__, x); + m_context.m_count--; + if (m_context.m_count == 0) + { + setState(IStateMachine::IDLE); + } + } + +private: + Context &m_context; +}; + +int main(int argc, char** argv) +{ + Context ctx; + StateMachine fsm; + StateInit init(ctx); + StateIdle idle(ctx); + StateActive0 active0(ctx); + StateActive1 active1(ctx); + + fsm.add(IStateMachine::INIT, &init); + fsm.add(IStateMachine::IDLE, &idle); + fsm.add(IStateMachine::ACTIVE_0, &active0); + fsm.add(IStateMachine::ACTIVE_1, &active1); + + for (int i=0; i < 1000; i++) + { + fsm.process(i); + } + + return 0; +} + diff --git a/nbproject/Makefile-Debug.mk b/nbproject/Makefile-Debug.mk new file mode 100644 index 0000000..0d86162 --- /dev/null +++ b/nbproject/Makefile-Debug.mk @@ -0,0 +1,84 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=MinGW-Windows +CND_DLIB_EXT=dll +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval.exe + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval.exe: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/main.o: main.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + ${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval.exe + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/nbproject/Makefile-Release.mk b/nbproject/Makefile-Release.mk new file mode 100644 index 0000000..83820ae --- /dev/null +++ b/nbproject/Makefile-Release.mk @@ -0,0 +1,84 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=MinGW-Windows +CND_DLIB_EXT=dll +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval.exe + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval.exe: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/main.o: main.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + ${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval.exe + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/nbproject/Makefile-impl.mk b/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..db35452 --- /dev/null +++ b/nbproject/Makefile-impl.mk @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=FsmEval + +# Active Configuration +DEFAULTCONF=Debug +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Debug Release + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/nbproject/Makefile-variables.mk b/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..e689295 --- /dev/null +++ b/nbproject/Makefile-variables.mk @@ -0,0 +1,35 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=MinGW-Windows +CND_ARTIFACT_DIR_Debug=dist/Debug/MinGW-Windows +CND_ARTIFACT_NAME_Debug=fsmeval +CND_ARTIFACT_PATH_Debug=dist/Debug/MinGW-Windows/fsmeval +CND_PACKAGE_DIR_Debug=dist/Debug/MinGW-Windows/package +CND_PACKAGE_NAME_Debug=fsmeval.tar +CND_PACKAGE_PATH_Debug=dist/Debug/MinGW-Windows/package/fsmeval.tar +# Release configuration +CND_PLATFORM_Release=MinGW-Windows +CND_ARTIFACT_DIR_Release=dist/Release/MinGW-Windows +CND_ARTIFACT_NAME_Release=fsmeval +CND_ARTIFACT_PATH_Release=dist/Release/MinGW-Windows/fsmeval +CND_PACKAGE_DIR_Release=dist/Release/MinGW-Windows/package +CND_PACKAGE_NAME_Release=fsmeval.tar +CND_PACKAGE_PATH_Release=dist/Release/MinGW-Windows/package/fsmeval.tar +# +# include compiler specific variables +# +# dmake command +ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \ + (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk) +# +# gmake command +.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)) +# +include nbproject/private/Makefile-variables.mk diff --git a/nbproject/Package-Debug.bash b/nbproject/Package-Debug.bash new file mode 100644 index 0000000..3047e25 --- /dev/null +++ b/nbproject/Package-Debug.bash @@ -0,0 +1,76 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=MinGW-Windows +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build +CND_DLIB_EXT=dll +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval +OUTPUT_BASENAME=fsmeval +PACKAGE_TOP_DIR=fsmeval/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/fsmeval/bin" +copyFileToTmpDir "${OUTPUT_PATH}.exe" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}.exe" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/fsmeval.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/fsmeval.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/nbproject/Package-Release.bash b/nbproject/Package-Release.bash new file mode 100644 index 0000000..a514941 --- /dev/null +++ b/nbproject/Package-Release.bash @@ -0,0 +1,76 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=MinGW-Windows +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build +CND_DLIB_EXT=dll +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/fsmeval +OUTPUT_BASENAME=fsmeval +PACKAGE_TOP_DIR=fsmeval/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/fsmeval/bin" +copyFileToTmpDir "${OUTPUT_PATH}.exe" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}.exe" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/fsmeval.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/fsmeval.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml new file mode 100644 index 0000000..865d6f3 --- /dev/null +++ b/nbproject/configurations.xml @@ -0,0 +1,81 @@ + + + + + AState.hpp + AStateMachine.hpp + IStateMachine.hpp + + + + + main.cpp + + + + + Makefile + + + Makefile + + + + default + true + false + + + + + + + + + + + + + + + default + true + false + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + + + + + + diff --git a/nbproject/private/Makefile-variables.mk b/nbproject/private/Makefile-variables.mk new file mode 100644 index 0000000..a64183e --- /dev/null +++ b/nbproject/private/Makefile-variables.mk @@ -0,0 +1,7 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +# Debug configuration +# Release configuration diff --git a/nbproject/private/configurations.xml b/nbproject/private/configurations.xml new file mode 100644 index 0000000..594c335 --- /dev/null +++ b/nbproject/private/configurations.xml @@ -0,0 +1,75 @@ + + + Makefile + + + + localhost + 3 + + + + + + + + + + + + + + + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 2 + 0 + 0 + + + + + + + localhost + 3 + + + + + + + + + + + + + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 0 + 0 + + + + + + diff --git a/nbproject/private/launcher.properties b/nbproject/private/launcher.properties new file mode 100644 index 0000000..6cc2127 --- /dev/null +++ b/nbproject/private/launcher.properties @@ -0,0 +1,40 @@ +# Launchers File syntax: +# +# [Must-have property line] +# launcher1.runCommand= +# [Optional extra properties] +# launcher1.displayName= +# launcher1.buildCommand= +# launcher1.runDir= +# launcher1.symbolFiles= +# launcher1.env.= +# (If this value is quoted with ` it is handled as a native command which execution result will become the value) +# [Common launcher properties] +# common.runDir= +# (This value is overwritten by a launcher specific runDir value if the latter exists) +# common.env.= +# (Environment variables from common launcher are merged with launcher specific variables) +# common.symbolFiles= +# (This value is overwritten by a launcher specific symbolFiles value if the latter exists) +# +# In runDir, symbolFiles and env fields you can use these macroses: +# ${PROJECT_DIR} - project directory absolute path +# ${OUTPUT_PATH} - linker output path (relative to project directory path) +# ${OUTPUT_BASENAME}- linker output filename +# ${TESTDIR} - test files directory (relative to project directory path) +# ${OBJECTDIR} - object files directory (relative to project directory path) +# ${CND_DISTDIR} - distribution directory (relative to project directory path) +# ${CND_BUILDDIR} - build directory (relative to project directory path) +# ${CND_PLATFORM} - platform name +# ${CND_CONF} - configuration name +# ${CND_DLIB_EXT} - dynamic library extension +# +# All the project launchers must be listed in the file! +# +# launcher1.runCommand=... +# launcher2.runCommand=... +# ... +# common.runDir=... +# common.env.KEY=VALUE + +# launcher1.runCommand= \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..c568de0 --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,11 @@ + + + + 1 + 0 + + + + + + diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..dafc3b9 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,28 @@ + + + org.netbeans.modules.cnd.makeproject + + + FsmEval + + cpp + hpp + UTF-8 + + + + + Debug + 1 + + + Release + 1 + + + + false + + + +