├── .gitignore ├── CHANGELOG.md ├── DISCLAIMER ├── LICENSE ├── Makefile.am ├── Makefile.in ├── README.md ├── aclocal.m4 ├── build-aux ├── ar-lib ├── config.guess ├── config.sub ├── depcomp ├── install-sh ├── ltmain.sh └── missing ├── builds └── msvc │ ├── .gitignore │ ├── config.h │ ├── properties │ ├── Common.props │ ├── DLL.props │ ├── Debug.props │ ├── DebugDEXE.props │ ├── DebugDLL.props │ ├── DebugLEXE.props │ ├── DebugLIB.props │ ├── DebugLTCG.props │ ├── DebugSEXE.props │ ├── EXE.props │ ├── LIB.props │ ├── LTCG.props │ ├── Link.props │ ├── Messages.props │ ├── Output.props │ ├── Release.props │ ├── ReleaseDEXE.props │ ├── ReleaseDLL.props │ ├── ReleaseLEXE.props │ ├── ReleaseLIB.props │ ├── ReleaseLTCG.props │ ├── ReleaseSEXE.props │ ├── Win32.props │ └── x64.props │ ├── vs2010 │ ├── .gitignore │ ├── czmq.import.props │ ├── czmq.import.xml │ ├── fncs.sln │ ├── fncs_broker │ │ ├── fncs_broker.props │ │ └── fncs_broker.vcxproj │ ├── fncs_netdelay │ │ ├── fncs_netdelay.props │ │ └── fncs_netdelay.vcxproj │ ├── fncs_player │ │ ├── fncs_player.props │ │ └── fncs_player.vcxproj │ ├── fncs_player_anon │ │ ├── fncs_player_anon.props │ │ └── fncs_player_anon.vcxproj │ ├── fncs_tracer │ │ ├── fncs_tracer.props │ │ └── fncs_tracer.vcxproj │ ├── libfncs.import.props │ ├── libfncs.import.xml │ ├── libfncs │ │ ├── libfncs.props │ │ ├── libfncs.vcxproj │ │ └── libfncs.vcxproj.filters │ ├── libsodium.import.props │ ├── libsodium.import.xml │ ├── libzmq.import.props │ └── libzmq.import.xml │ ├── vs2012 │ ├── .gitignore │ ├── czmq.import.props │ ├── czmq.import.xml │ ├── fncs.sln │ ├── fncs_broker │ │ ├── fncs_broker.props │ │ └── fncs_broker.vcxproj │ ├── fncs_netdelay │ │ ├── fncs_netdelay.props │ │ └── fncs_netdelay.vcxproj │ ├── fncs_player │ │ ├── fncs_player.props │ │ └── fncs_player.vcxproj │ ├── fncs_player_anon │ │ ├── fncs_player_anon.props │ │ └── fncs_player_anon.vcxproj │ ├── fncs_tracer │ │ ├── fncs_tracer.props │ │ └── fncs_tracer.vcxproj │ ├── libfncs.import.props │ ├── libfncs.import.xml │ ├── libfncs │ │ ├── libfncs.props │ │ ├── libfncs.vcxproj │ │ └── libfncs.vcxproj.filters │ ├── libsodium.import.props │ ├── libsodium.import.xml │ ├── libzmq.import.props │ └── libzmq.import.xml │ └── vs2013 │ ├── .gitignore │ ├── czmq.import.props │ ├── czmq.import.xml │ ├── fncs.sln │ ├── fncs_broker │ ├── fncs_broker.props │ └── fncs_broker.vcxproj │ ├── fncs_netdelay │ ├── fncs_netdelay.props │ └── fncs_netdelay.vcxproj │ ├── fncs_player │ ├── fncs_player.props │ └── fncs_player.vcxproj │ ├── fncs_player_anon │ ├── fncs_player_anon.props │ └── fncs_player_anon.vcxproj │ ├── fncs_tracer │ ├── fncs_tracer.props │ └── fncs_tracer.vcxproj │ ├── libfncs.import.props │ ├── libfncs.import.xml │ ├── libfncs │ ├── libfncs.props │ ├── libfncs.vcxproj │ └── libfncs.vcxproj.filters │ ├── libsodium.import.props │ ├── libsodium.import.xml │ ├── libzmq.import.props │ └── libzmq.import.xml ├── config.h.in ├── configure ├── configure.ac ├── contrib ├── log.h └── yaml-cpp │ ├── .hgeol │ ├── .hgignore │ ├── CMakeLists.txt │ ├── include │ └── yaml-cpp │ │ ├── aliasmanager.h │ │ ├── anchor.h │ │ ├── binary.h │ │ ├── contrib │ │ ├── anchordict.h │ │ └── graphbuilder.h │ │ ├── conversion.h │ │ ├── dll.h │ │ ├── emitfromevents.h │ │ ├── emitter.h │ │ ├── emittermanip.h │ │ ├── eventhandler.h │ │ ├── exceptions.h │ │ ├── iterator.h │ │ ├── ltnode.h │ │ ├── mark.h │ │ ├── node.h │ │ ├── nodeimpl.h │ │ ├── nodereadimpl.h │ │ ├── nodeutil.h │ │ ├── noncopyable.h │ │ ├── null.h │ │ ├── ostream.h │ │ ├── parser.h │ │ ├── stlemitter.h │ │ ├── stlnode.h │ │ ├── traits.h │ │ └── yaml.h │ ├── install.txt │ ├── license.txt │ ├── src │ ├── aliasmanager.cpp │ ├── binary.cpp │ ├── collectionstack.h │ ├── contrib │ │ ├── graphbuilder.cpp │ │ ├── graphbuilderadapter.cpp │ │ └── graphbuilderadapter.h │ ├── conversion.cpp │ ├── directives.cpp │ ├── directives.h │ ├── emitfromevents.cpp │ ├── emitter.cpp │ ├── emitterstate.cpp │ ├── emitterstate.h │ ├── emitterutils.cpp │ ├── emitterutils.h │ ├── exp.cpp │ ├── exp.h │ ├── indentation.h │ ├── iterator.cpp │ ├── iterpriv.h │ ├── node.cpp │ ├── nodebuilder.cpp │ ├── nodebuilder.h │ ├── nodeownership.cpp │ ├── nodeownership.h │ ├── null.cpp │ ├── ostream.cpp │ ├── parser.cpp │ ├── ptr_stack.h │ ├── ptr_vector.h │ ├── regex.cpp │ ├── regex.h │ ├── regeximpl.h │ ├── scanner.cpp │ ├── scanner.h │ ├── scanscalar.cpp │ ├── scanscalar.h │ ├── scantag.cpp │ ├── scantag.h │ ├── scantoken.cpp │ ├── setting.h │ ├── simplekey.cpp │ ├── singledocparser.cpp │ ├── singledocparser.h │ ├── stream.cpp │ ├── stream.h │ ├── streamcharsource.h │ ├── stringsource.h │ ├── tag.cpp │ ├── tag.h │ └── token.h │ ├── test │ ├── CMakeLists.txt │ ├── emittertests.cpp │ ├── emittertests.h │ ├── main.cpp │ ├── nodetests.h │ ├── old-api │ │ ├── parsertests.cpp │ │ └── spectests.cpp │ ├── parsertests.h │ ├── specexamples.h │ ├── spectests.cpp │ ├── spectests.h │ ├── tests.cpp │ └── tests.h │ ├── util │ ├── CMakeLists.txt │ ├── api.cpp │ └── parse.cpp │ └── yaml-cpp.pc.cmake ├── m4 ├── fncs_arg_parse.m4 ├── fncs_check_func.m4 ├── fncs_check_header.m4 ├── fncs_check_package.m4 ├── fncs_cxx_nullptr.m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 └── lt~obsolete.m4 ├── matlab ├── .gitignore ├── build.sh ├── build_mex.bat ├── fncs_die.cpp ├── fncs_finalize.cpp ├── fncs_get_events.cpp ├── fncs_get_events_size.cpp ├── fncs_get_value.cpp ├── fncs_get_values.cpp ├── fncs_get_values_size.cpp ├── fncs_initialize.cpp ├── fncs_is_initialized.cpp ├── fncs_publish.cpp ├── fncs_publish_anon.cpp ├── fncs_route.cpp ├── fncs_time_request.cpp └── to_fncs_time.hpp ├── python ├── fncs.cpp ├── fncs.py ├── fncs.pyx ├── fncshpp.pxd ├── setup.py └── test.py ├── src ├── broker.cpp ├── echo.cpp ├── echo.hpp ├── fncs.cpp ├── fncs.h ├── fncs.hpp ├── fncs_capi.cpp ├── fncs_internal.hpp ├── libfncs.pc.in ├── libfncs.vers ├── log.hpp ├── player.cpp └── tracer.cpp ├── tests ├── config.cpp ├── netdelay.cpp └── test.cpp └── version.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | *.o 4 | *.lo 5 | .deps 6 | .dirstamp 7 | .libs 8 | *.exe 9 | Makefile 10 | autom4te.cache/ 11 | config.h 12 | config.log 13 | config.status 14 | libfncs.la 15 | libtool 16 | stamp-h1 17 | bld*/ 18 | /bin/ 19 | /obj/ 20 | /lib/ 21 | .autotools 22 | .cproject 23 | .project 24 | .pydevproject 25 | .settings/ 26 | fncs_broker 27 | fncs_player 28 | fncs_player_anon 29 | fncs_tracer 30 | libyamlcpp.la 31 | src/libfncs.pc 32 | -------------------------------------------------------------------------------- /DISCLAIMER: -------------------------------------------------------------------------------- 1 | This material was prepared as an account of work sponsored by an agency 2 | of the United States Government. Neither the United States Government 3 | nor the United States Department of Energy, nor Battelle, nor any of 4 | their employees, nor any jurisdiction or organization that has 5 | cooperated in the development of these materials, makes any warranty, 6 | express or implied, or assumes any legal liability or responsibility for 7 | the accuracy, completeness, or usefulness or any information, apparatus, 8 | product, software, or process disclosed, or represents that its use 9 | would not infringe privately owned rights. 10 | 11 | Reference herein to any specific commercial product, process, or service 12 | by trade name, trademark, manufacturer, or otherwise does not 13 | necessarily constitute or imply its endorsement, recommendation, or 14 | favoring by the United States Government or any agency thereof, or 15 | Battelle Memorial Institute. The views and opinions of authors expressed 16 | herein do not necessarily state or reflect those of the United States 17 | Government or any agency thereof. 18 | 19 | PACIFIC NORTHWEST NATIONAL LABORATORY 20 | operated by 21 | BATTELLE 22 | for the 23 | UNITED STATES DEPARTMENT OF ENERGY 24 | under Contract DE-AC05-76RL01830 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Framework for Network Co-Simulation (FNCS) 2.0 2 | 3 | Copyright © 2013, Battelle Memorial Institute 4 | All rights reserved. 5 | 6 | 1. Battelle Memorial Institute (hereinafter Battelle) hereby grants permission 7 | to any person or entity lawfully obtaining a copy of this software and 8 | associated documentation files (hereinafter “the Software”) to redistribute 9 | and use the Software in source and binary forms, with or without 10 | modification. Such person or entity may use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and may permit 12 | others to do so, subject to the following conditions: 13 | 14 | - Redistributions of source code must retain the above copyright notice, 15 | this list of conditions and the following disclaimers. 16 | 17 | - Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | 21 | - Other than as used herein, neither the name Battelle Memorial Institute or 22 | Battelle may be used in any form whatsoever without the express written 23 | consent of Battelle. 24 | 25 | - Redistributions of the software in any form, and publications and 26 | presentations based on work performed using the software should include 27 | the following acknowledgement: 28 | 29 | The FNCS Software was developed by Battelle at the Pacific Northwest 30 | National Laboratory under Contract Number DE-AC05-76RL01830 with the 31 | U.S. Department of Energy. 32 | 33 | 2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 34 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 35 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 36 | ARE DISCLAIMED. IN NO EVENT SHALL BATTELLE OR CONTRIBUTORS BE LIABLE FOR ANY 37 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 38 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 40 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 42 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | 44 | -------------------------------------------------------------------------------- /builds/msvc/.gitignore: -------------------------------------------------------------------------------- 1 | *.opensdf 2 | *.suo 3 | *.sdf 4 | *.user 5 | *.aps 6 | *.log 7 | -------------------------------------------------------------------------------- /builds/msvc/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2007-2011 iMatix Corporation 3 | Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file 4 | 5 | This file is part of 0MQ. 6 | 7 | 0MQ is free software; you can redistribute it and/or modify it under 8 | the terms of the GNU Lesser General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | 0MQ is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public License 18 | along with this program. If not, see . 19 | */ 20 | 21 | #ifndef __PLATFORM_H_INCLUDED__ 22 | #define __PLATFORM_H_INCLUDED__ 23 | 24 | // This is the platform definition for the MSVC platform. 25 | // As a first step of the build process it is copied to 26 | // zmq directory to take place of platform.hpp generated from 27 | // platform.hpp.in on platforms supported by GNU autotools. 28 | // Place any MSVC-specific definitions here. 29 | 30 | #define CZMQ_HAVE_WINDOWS 31 | 32 | #define HAVE_LIBUUID 1 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /builds/msvc/properties/Common.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Common Settings 6 | Unicode 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | true 16 | UNICODE;_UNICODE;%(PreprocessorDefinitions) 17 | Level3 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /builds/msvc/properties/DLL.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Dynamic Library 6 | dynamic 7 | .dll 8 | 9 | 10 | 11 | 12 | _DLL;_WINDLL;%(PreprocessorDefinitions) 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /builds/msvc/properties/Debug.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <_PropertySheetDisplayName>Debug Settings 10 | Debug 11 | 12 | 13 | 14 | 15 | EnableFastChecks 16 | ProgramDatabase 17 | true 18 | Disabled 19 | _DEBUG;%(PreprocessorDefinitions) 20 | 21 | 22 | _DEBUG;%(PreprocessorDefinitions) 23 | 24 | 25 | true 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /builds/msvc/properties/DebugDEXE.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Console Debug Dynamic 6 | dynamic 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | MultiThreadedDebugDLL 17 | true 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /builds/msvc/properties/DebugDLL.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Dynamic Debug Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | MultiThreadedDebugDLL 16 | true 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /builds/msvc/properties/DebugLEXE.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Console Debug Link Time Code Generation 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | MultiThreadedDebug 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /builds/msvc/properties/DebugLIB.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Static Debug Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | OldStyle 16 | MultiThreadedDebug 17 | true 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /builds/msvc/properties/DebugLTCG.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Static Debug Link Time Code Generation Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | OldStyle 16 | MultiThreadedDebug 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /builds/msvc/properties/DebugSEXE.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Console Debug Static 6 | static 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | MultiThreadedDebug 17 | true 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /builds/msvc/properties/EXE.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Console Application 6 | true 7 | 8 | 9 | 10 | 11 | _CONSOLE;%(PreprocessorDefinitions) 12 | 13 | 14 | Console 15 | 16 | 17 | -------------------------------------------------------------------------------- /builds/msvc/properties/LIB.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Static Library 6 | static 7 | .lib 8 | 9 | 10 | 11 | 12 | _LIB;%(PreprocessorDefinitions) 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /builds/msvc/properties/LTCG.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Link Time Code Generation Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /builds/msvc/properties/Link.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Link Time Code Generation Settings 6 | ltcg 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | UseLinkTimeCodeGeneration 15 | 16 | 17 | true 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /builds/msvc/properties/Messages.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Build Messages 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /builds/msvc/properties/Output.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Output Settings 6 | 7 | $(ProjectDir)..\..\ 8 | $(ProjectDir)..\..\..\..\ 9 | $(ProjectDir)..\..\..\..\..\ 10 | $(ProjectDir)..\..\..\..\bin\$(PlatformName)\$(DebugOrRelease)\$(PlatformToolset)\$(DefaultLinkage)\ 11 | $(ProjectDir)..\..\..\..\obj\$(TargetName)\$(PlatformName)\$(DebugOrRelease)\$(PlatformToolset)\$(DefaultLinkage)\ 12 | $(OutDir) 13 | $(TargetName) 14 | $(TargetDir)$(TargetName)$(TargetExt) 15 | 16 | 17 | 18 | 19 | $(OutDir)$(TargetName).lib 20 | 21 | 22 | $(OutDir)$(TargetName).log 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /builds/msvc/properties/Release.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <_PropertySheetDisplayName>Release Settings 10 | Release 11 | false 12 | 13 | 14 | 15 | 16 | /Oy- %(AdditionalOptions) 17 | 18 | true 19 | true 20 | OnlyExplicitInline 21 | false 22 | MaxSpeed 23 | NDEBUG;%(PreprocessorDefinitions) 24 | 25 | 26 | NDEBUG;%(PreprocessorDefinitions) 27 | 28 | 29 | true 30 | 31 | true 32 | 33 | 34 | 35 | 36 | 37 | StreamingSIMDExtensions2 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /builds/msvc/properties/ReleaseDEXE.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Console Release Dynamic 6 | dynamic 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | MultiThreadedDLL 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /builds/msvc/properties/ReleaseDLL.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Dynamic Release Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | MultiThreadedDLL 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /builds/msvc/properties/ReleaseLEXE.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Console Release Link Time Code Generation 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | MultiThreaded 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /builds/msvc/properties/ReleaseLIB.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Static Release Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | MultiThreaded 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /builds/msvc/properties/ReleaseLTCG.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Static Release Link Time Code Generation Library 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | MultiThreaded 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /builds/msvc/properties/ReleaseSEXE.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>Console Release Static 6 | static 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | MultiThreaded 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /builds/msvc/properties/Win32.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>x86 Settings 6 | 7 | 8 | 9 | 10 | WIN32;_WIN32;%(PreprocessorDefinitions) 11 | 12 | 13 | MachineX86 14 | 15 | 16 | /MACHINE:X86 %(AdditionalOptions) 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /builds/msvc/properties/x64.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>x64 Settings 6 | 7 | 8 | 9 | 10 | 13 | WIN32;_WIN32;WIN64;_WIN64;%(PreprocessorDefinitions) 14 | 15 | 16 | MachineX64 17 | 18 | 19 | /MACHINE:X64 %(AdditionalOptions) 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/.gitignore: -------------------------------------------------------------------------------- 1 | /ipch/ 2 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/czmq.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/fncs_broker/fncs_broker.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Broker Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/fncs_netdelay/fncs_netdelay.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Network Delay Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/fncs_player/fncs_player.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Player Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/fncs_tracer/fncs_tracer.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Tracer Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/libfncs.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/libfncs/libfncs.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | src 12 | 13 | 14 | src 15 | 16 | 17 | src 18 | 19 | 20 | 21 | 22 | {48f852d3-9723-4499-bf1a-35c0234b8ba9} 23 | 24 | 25 | 26 | 27 | src 28 | 29 | 30 | src 31 | 32 | 33 | src 34 | 35 | 36 | src 37 | 38 | 39 | src 40 | 41 | 42 | 48 | 49 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/libsodium.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /builds/msvc/vs2010/libzmq.import.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/.gitignore: -------------------------------------------------------------------------------- 1 | /ipch/ 2 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/czmq.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/fncs_broker/fncs_broker.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Broker Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/fncs_netdelay/fncs_netdelay.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Network Delay Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/fncs_player/fncs_player.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Player Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/fncs_tracer/fncs_tracer.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Tracer Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/libfncs.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/libfncs/libfncs.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | src 12 | 13 | 14 | src 15 | 16 | 17 | src 18 | 19 | 20 | 21 | 22 | {48f852d3-9723-4499-bf1a-35c0234b8ba9} 23 | 24 | 25 | 26 | 27 | src 28 | 29 | 30 | src 31 | 32 | 33 | src 34 | 35 | 36 | src 37 | 38 | 39 | src 40 | 41 | 42 | 48 | 49 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/libsodium.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /builds/msvc/vs2012/libzmq.import.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/.gitignore: -------------------------------------------------------------------------------- 1 | /ipch/ 2 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/czmq.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/fncs_broker/fncs_broker.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Broker Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/fncs_netdelay/fncs_netdelay.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Network Delay Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/fncs_player/fncs_player.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Player Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/fncs_tracer/fncs_tracer.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | <_PropertySheetDisplayName>FNCS Tracer Common Settings 6 | AllRules.ruleset 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | $(BuildRoot);$(ProjectDir)..\..\..\..\src;$(ProjectDir)..\..\..\..\contrib;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\include;$(ProjectDir)..\..\..\..\contrib\yaml-cpp\src;%(AdditionalIncludeDirectories) 15 | CompileAsCpp 16 | %(DisableSpecificWarnings) 17 | false 18 | %(PreprocessorDefinitions) 19 | 20 | 21 | Iphlpapi.lib;Rpcrt4.lib;Ws2_32.lib;%(AdditionalDependencies) 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | dynamic 36 | dynamic 37 | dynamic 38 | dynamic 39 | 40 | 41 | ltcg 42 | ltcg 43 | ltcg 44 | ltcg 45 | 46 | 47 | static 48 | static 49 | static 50 | static 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/libfncs.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/libfncs/libfncs.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | src 12 | 13 | 14 | src 15 | 16 | 17 | src 18 | 19 | 20 | 21 | 22 | {48f852d3-9723-4499-bf1a-35c0234b8ba9} 23 | 24 | 25 | 26 | 27 | src 28 | 29 | 30 | src 31 | 32 | 33 | src 34 | 35 | 36 | src 37 | 38 | 39 | src 40 | 41 | 42 | 48 | 49 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/libsodium.import.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /builds/msvc/vs2013/libzmq.import.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/.hgeol: -------------------------------------------------------------------------------- 1 | **.h = native 2 | **.c = native 3 | **.cpp = native 4 | **.txt = native 5 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/aliasmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef ALIASMANAGER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ALIASMANAGER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/anchor.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class Node; 14 | 15 | class AliasManager 16 | { 17 | public: 18 | AliasManager(); 19 | 20 | void RegisterReference(const Node& node); 21 | anchor_t LookupAnchor(const Node& node) const; 22 | 23 | private: 24 | anchor_t _CreateNewAnchor(); 25 | 26 | private: 27 | typedef std::map AnchorByIdentity; 28 | AnchorByIdentity m_anchorByIdentity; 29 | 30 | anchor_t m_curAnchor; 31 | }; 32 | } 33 | 34 | #endif // ALIASMANAGER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 35 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/anchor.h: -------------------------------------------------------------------------------- 1 | #ifndef ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | 10 | namespace YAML 11 | { 12 | typedef std::size_t anchor_t; 13 | const anchor_t NullAnchor = 0; 14 | } 15 | 16 | #endif // ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 17 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/binary.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class Node; 14 | 15 | std::string EncodeBase64(const unsigned char *data, std::size_t size); 16 | std::vector DecodeBase64(const std::string& input); 17 | 18 | class Binary { 19 | public: 20 | Binary(): m_unownedData(0), m_unownedSize(0) {} 21 | Binary(const unsigned char *data, std::size_t size): m_unownedData(data), m_unownedSize(size) {} 22 | 23 | bool owned() const { return !m_unownedData; } 24 | std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; } 25 | const unsigned char *data() const { return owned() ? &m_data[0] : m_unownedData; } 26 | 27 | void swap(std::vector& rhs) { 28 | if(m_unownedData) { 29 | m_data.swap(rhs); 30 | rhs.clear(); 31 | rhs.resize(m_unownedSize); 32 | std::copy(m_unownedData, m_unownedData + m_unownedSize, &rhs[0]); 33 | m_unownedData = 0; 34 | m_unownedSize = 0; 35 | } else { 36 | m_data.swap(rhs); 37 | } 38 | } 39 | 40 | bool operator == (const Binary& rhs) const { 41 | const std::size_t s = size(); 42 | if(s != rhs.size()) 43 | return false; 44 | const unsigned char *d1 = data(); 45 | const unsigned char *d2 = rhs.data(); 46 | for(std::size_t i=0;i m_data; 59 | const unsigned char *m_unownedData; 60 | std::size_t m_unownedSize; 61 | }; 62 | 63 | void operator >> (const Node& node, Binary& binary); 64 | } 65 | 66 | #endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 67 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/contrib/anchordict.h: -------------------------------------------------------------------------------- 1 | #ifndef ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | 10 | #include "../anchor.h" 11 | 12 | namespace YAML 13 | { 14 | /// AnchorDict 15 | /// . An object that stores and retrieves values correlating to anchor_t 16 | /// values. 17 | /// . Efficient implementation that can make assumptions about how anchor_t 18 | /// values are assigned by the Parser class. 19 | template 20 | class AnchorDict 21 | { 22 | public: 23 | void Register(anchor_t anchor, T value) 24 | { 25 | if (anchor > m_data.size()) 26 | { 27 | m_data.resize(anchor); 28 | } 29 | m_data[anchor - 1] = value; 30 | } 31 | 32 | T Get(anchor_t anchor) const 33 | { 34 | return m_data[anchor - 1]; 35 | } 36 | 37 | private: 38 | std::vector m_data; 39 | }; 40 | } 41 | 42 | #endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 43 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/conversion.h: -------------------------------------------------------------------------------- 1 | #ifndef CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/null.h" 10 | #include "yaml-cpp/traits.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML 16 | { 17 | // traits for conversion 18 | 19 | template 20 | struct is_scalar_convertible { enum { value = is_numeric::value }; }; 21 | 22 | template<> struct is_scalar_convertible { enum { value = true }; }; 23 | template<> struct is_scalar_convertible { enum { value = true }; }; 24 | template<> struct is_scalar_convertible<_Null> { enum { value = true }; }; 25 | 26 | // actual conversion 27 | 28 | inline bool Convert(const std::string& input, std::string& output) { 29 | output = input; 30 | return true; 31 | } 32 | 33 | YAML_CPP_API bool Convert(const std::string& input, bool& output); 34 | YAML_CPP_API bool Convert(const std::string& input, _Null& output); 35 | 36 | inline bool IsInfinity(const std::string& input) { 37 | return input == ".inf" || input == ".Inf" || input == ".INF" || input == "+.inf" || input == "+.Inf" || input == "+.INF"; 38 | } 39 | 40 | inline bool IsNegativeInfinity(const std::string& input) { 41 | return input == "-.inf" || input == "-.Inf" || input == "-.INF"; 42 | } 43 | 44 | inline bool IsNaN(const std::string& input) { 45 | return input == ".nan" || input == ".NaN" || input == ".NAN"; 46 | } 47 | 48 | 49 | template 50 | inline bool Convert(const std::string& input, T& output, typename enable_if >::type * = 0) { 51 | std::stringstream stream(input); 52 | stream.unsetf(std::ios::dec); 53 | if((stream >> output) && (stream >> std::ws).eof()) 54 | return true; 55 | 56 | if(std::numeric_limits::has_infinity) { 57 | if(IsInfinity(input)) { 58 | output = std::numeric_limits::infinity(); 59 | return true; 60 | } else if(IsNegativeInfinity(input)) { 61 | output = -std::numeric_limits::infinity(); 62 | return true; 63 | } 64 | } 65 | 66 | if(std::numeric_limits::has_quiet_NaN && IsNaN(input)) { 67 | output = std::numeric_limits::quiet_NaN(); 68 | return true; 69 | } 70 | 71 | return false; 72 | } 73 | } 74 | 75 | #endif // CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 76 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/dll.h: -------------------------------------------------------------------------------- 1 | #ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | // The following ifdef block is the standard way of creating macros which make exporting 9 | // from a DLL simpler. All files within this DLL are compiled with the yaml_cpp_EXPORTS 10 | // symbol defined on the command line. this symbol should not be defined on any project 11 | // that uses this DLL. This way any other project whose source files include this file see 12 | // YAML_CPP_API functions as being imported from a DLL, whereas this DLL sees symbols 13 | // defined with this macro as being exported. 14 | #undef YAML_CPP_API 15 | 16 | #ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined manually) 17 | #ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake or defined manually) 18 | // #pragma message( "Defining YAML_CPP_API for DLL export" ) 19 | #define YAML_CPP_API __declspec(dllexport) 20 | #else // yaml_cpp_EXPORTS 21 | // #pragma message( "Defining YAML_CPP_API for DLL import" ) 22 | #define YAML_CPP_API __declspec(dllimport) 23 | #endif // yaml_cpp_EXPORTS 24 | #else //YAML_CPP_DLL 25 | #define YAML_CPP_API 26 | #endif // YAML_CPP_DLL 27 | 28 | #endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 29 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/emitfromevents.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/eventhandler.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class Emitter; 14 | 15 | class EmitFromEvents: public EventHandler 16 | { 17 | public: 18 | EmitFromEvents(Emitter& emitter); 19 | 20 | virtual void OnDocumentStart(const Mark& mark); 21 | virtual void OnDocumentEnd(); 22 | 23 | virtual void OnNull(const Mark& mark, anchor_t anchor); 24 | virtual void OnAlias(const Mark& mark, anchor_t anchor); 25 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value); 26 | 27 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor); 28 | virtual void OnSequenceEnd(); 29 | 30 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor); 31 | virtual void OnMapEnd(); 32 | 33 | private: 34 | void BeginNode(); 35 | void EmitProps(const std::string& tag, anchor_t anchor); 36 | 37 | private: 38 | Emitter& m_emitter; 39 | 40 | struct State { enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue }; }; 41 | std::stack m_stateStack; 42 | }; 43 | } 44 | 45 | #endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 46 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/eventhandler.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/anchor.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | struct Mark; 14 | 15 | class EventHandler 16 | { 17 | public: 18 | virtual ~EventHandler() {} 19 | 20 | virtual void OnDocumentStart(const Mark& mark) = 0; 21 | virtual void OnDocumentEnd() = 0; 22 | 23 | virtual void OnNull(const Mark& mark, anchor_t anchor) = 0; 24 | virtual void OnAlias(const Mark& mark, anchor_t anchor) = 0; 25 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value) = 0; 26 | 27 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor) = 0; 28 | virtual void OnSequenceEnd() = 0; 29 | 30 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor) = 0; 31 | virtual void OnMapEnd() = 0; 32 | }; 33 | } 34 | 35 | #endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 36 | 37 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/iterator.h: -------------------------------------------------------------------------------- 1 | #ifndef ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/dll.h" 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class Node; 14 | struct IterPriv; 15 | 16 | class YAML_CPP_API Iterator 17 | { 18 | public: 19 | Iterator(); 20 | Iterator(std::auto_ptr pData); 21 | Iterator(const Iterator& rhs); 22 | ~Iterator(); 23 | 24 | Iterator& operator = (const Iterator& rhs); 25 | Iterator& operator ++ (); 26 | Iterator operator ++ (int); 27 | const Node& operator * () const; 28 | const Node *operator -> () const; 29 | const Node& first() const; 30 | const Node& second() const; 31 | 32 | friend YAML_CPP_API bool operator == (const Iterator& it, const Iterator& jt); 33 | friend YAML_CPP_API bool operator != (const Iterator& it, const Iterator& jt); 34 | 35 | private: 36 | std::auto_ptr m_pData; 37 | }; 38 | } 39 | 40 | #endif // ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 41 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/ltnode.h: -------------------------------------------------------------------------------- 1 | #ifndef LTNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define LTNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | class Node; 12 | 13 | struct ltnode { 14 | bool operator()(const Node *pNode1, const Node *pNode2) const; 15 | }; 16 | } 17 | 18 | #endif // LTNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 19 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/mark.h: -------------------------------------------------------------------------------- 1 | #ifndef MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/dll.h" 10 | 11 | namespace YAML 12 | { 13 | struct YAML_CPP_API Mark { 14 | Mark(): pos(0), line(0), column(0) {} 15 | 16 | static const Mark null() { return Mark(-1, -1, -1); } 17 | 18 | int pos; 19 | int line, column; 20 | 21 | private: 22 | Mark(int pos_, int line_, int column_): pos(pos_), line(line_), column(column_) {} 23 | }; 24 | } 25 | 26 | #endif // MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 27 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/nodeimpl.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/nodeutil.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | // implementation of templated things 15 | template 16 | inline const T Node::to() const { 17 | T value; 18 | *this >> value; 19 | return value; 20 | } 21 | 22 | template 23 | inline typename enable_if >::type operator >> (const Node& node, T& value) { 24 | if(!ConvertScalar(node, value)) 25 | throw InvalidScalar(node.m_mark); 26 | } 27 | 28 | template 29 | inline const Node *Node::FindValue(const T& key) const { 30 | switch(m_type) { 31 | case NodeType::Null: 32 | case NodeType::Scalar: 33 | throw BadDereference(); 34 | case NodeType::Sequence: 35 | return FindFromNodeAtIndex(*this, key); 36 | case NodeType::Map: 37 | return FindValueForKey(key); 38 | } 39 | assert(false); 40 | throw BadDereference(); 41 | } 42 | 43 | template 44 | inline const Node *Node::FindValueForKey(const T& key) const { 45 | for(Iterator it=begin();it!=end();++it) { 46 | T t; 47 | if(it.first().Read(t)) { 48 | if(key == t) 49 | return &it.second(); 50 | } 51 | } 52 | 53 | return 0; 54 | } 55 | 56 | template 57 | inline const Node& Node::GetValue(const T& key) const { 58 | if(const Node *pValue = FindValue(key)) 59 | return *pValue; 60 | throw MakeTypedKeyNotFound(m_mark, key); 61 | } 62 | 63 | template 64 | inline const Node& Node::operator [] (const T& key) const { 65 | return GetValue(key); 66 | } 67 | 68 | inline const Node *Node::FindValue(const char *key) const { 69 | return FindValue(std::string(key)); 70 | } 71 | 72 | inline const Node *Node::FindValue(char *key) const { 73 | return FindValue(std::string(key)); 74 | } 75 | 76 | inline const Node& Node::operator [] (const char *key) const { 77 | return GetValue(std::string(key)); 78 | } 79 | 80 | inline const Node& Node::operator [] (char *key) const { 81 | return GetValue(std::string(key)); 82 | } 83 | } 84 | 85 | #endif // NODEIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 86 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/nodereadimpl.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEREADIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEREADIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | // implementation for Node::Read 12 | // (the goal is to call ConvertScalar if we can, and fall back to operator >> if not) 13 | // thanks to litb from stackoverflow.com 14 | // http://stackoverflow.com/questions/1386183/how-to-call-a-templated-function-if-it-exists-and-something-else-otherwise/1386390#1386390 15 | 16 | // Note: this doesn't work on gcc 3.2, but does on gcc 3.4 and above. I'm not sure about 3.3. 17 | 18 | #if __GNUC__ && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)) 19 | // trick doesn't work? Just fall back to ConvertScalar. 20 | // This means that we can't use any user-defined types as keys in a map 21 | template 22 | inline bool Node::Read(T& value) const { 23 | return ConvertScalar(*this, value); 24 | } 25 | #else 26 | // usual case: the trick! 27 | template 28 | struct read_impl; 29 | 30 | // ConvertScalar available 31 | template<> 32 | struct read_impl { 33 | template 34 | static bool read(const Node& node, T& value) { 35 | return ConvertScalar(node, value); 36 | } 37 | }; 38 | 39 | // ConvertScalar not available 40 | template<> 41 | struct read_impl { 42 | template 43 | static bool read(const Node& node, T& value) { 44 | try { 45 | node >> value; 46 | } catch(const Exception&) { 47 | return false; 48 | } 49 | return true; 50 | } 51 | }; 52 | 53 | namespace fallback { 54 | // sizeof > 1 55 | struct flag { char c[2]; }; 56 | flag Convert(...); 57 | 58 | int operator,(flag, flag); 59 | 60 | template 61 | char operator,(flag, T const&); 62 | 63 | char operator,(int, flag); 64 | int operator,(char, flag); 65 | } 66 | 67 | template 68 | inline bool Node::Read(T& value) const { 69 | using namespace fallback; 70 | 71 | return read_impl::read(*this, value); 72 | } 73 | #endif // done with trick 74 | 75 | // the main conversion function 76 | template 77 | inline bool ConvertScalar(const Node& node, T& value) { 78 | std::string scalar; 79 | if(!node.GetScalar(scalar)) 80 | return false; 81 | 82 | return Convert(scalar, value); 83 | } 84 | } 85 | 86 | #endif // NODEREADIMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 87 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/nodeutil.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEUTIL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEUTIL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | template 12 | struct is_same_type { 13 | enum { value = false }; 14 | }; 15 | 16 | template 17 | struct is_same_type { 18 | enum { value = true }; 19 | }; 20 | 21 | template 22 | struct is_index_type_with_check { 23 | enum { value = false }; 24 | }; 25 | 26 | template <> struct is_index_type_with_check { enum { value = true }; }; 27 | 28 | #define MAKE_INDEX_TYPE(Type) \ 29 | template <> struct is_index_type_with_check::value> { enum { value = true }; } 30 | 31 | MAKE_INDEX_TYPE(int); 32 | MAKE_INDEX_TYPE(unsigned); 33 | MAKE_INDEX_TYPE(short); 34 | MAKE_INDEX_TYPE(unsigned short); 35 | MAKE_INDEX_TYPE(long); 36 | MAKE_INDEX_TYPE(unsigned long); 37 | 38 | #undef MAKE_INDEX_TYPE 39 | 40 | template 41 | struct is_index_type: public is_index_type_with_check {}; 42 | 43 | // messing around with template stuff to get the right overload for operator [] for a sequence 44 | template 45 | struct _FindFromNodeAtIndex { 46 | const Node *pRet; 47 | _FindFromNodeAtIndex(const Node&, const T&): pRet(0) {} 48 | }; 49 | 50 | template 51 | struct _FindFromNodeAtIndex { 52 | const Node *pRet; 53 | _FindFromNodeAtIndex(const Node& node, const T& key): pRet(node.FindAtIndex(static_cast(key))) {} 54 | }; 55 | 56 | template 57 | inline const Node *FindFromNodeAtIndex(const Node& node, const T& key) { 58 | return _FindFromNodeAtIndex::value>(node, key).pRet; 59 | } 60 | } 61 | 62 | #endif // NODEUTIL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 63 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/noncopyable.h: -------------------------------------------------------------------------------- 1 | #ifndef NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/dll.h" 9 | 10 | namespace YAML 11 | { 12 | // this is basically boost::noncopyable 13 | class YAML_CPP_API noncopyable 14 | { 15 | protected: 16 | noncopyable() {} 17 | ~noncopyable() {} 18 | 19 | private: 20 | noncopyable(const noncopyable&); 21 | const noncopyable& operator = (const noncopyable&); 22 | }; 23 | } 24 | 25 | #endif // NONCOPYABLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 26 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/null.h: -------------------------------------------------------------------------------- 1 | #ifndef NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/dll.h" 10 | 11 | namespace YAML 12 | { 13 | class Node; 14 | 15 | struct YAML_CPP_API _Null {}; 16 | inline bool operator == (const _Null&, const _Null&) { return true; } 17 | inline bool operator != (const _Null&, const _Null&) { return false; } 18 | 19 | YAML_CPP_API bool IsNull(const Node& node); // old API only 20 | 21 | extern YAML_CPP_API _Null Null; 22 | } 23 | 24 | #endif // NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 25 | 26 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/ostream.h: -------------------------------------------------------------------------------- 1 | #ifndef OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class ostream 14 | { 15 | public: 16 | ostream(); 17 | ~ostream(); 18 | 19 | void reserve(unsigned size); 20 | void put(char ch); 21 | const char *str() const { return m_buffer; } 22 | 23 | unsigned row() const { return m_row; } 24 | unsigned col() const { return m_col; } 25 | unsigned pos() const { return m_pos; } 26 | 27 | private: 28 | char *m_buffer; 29 | unsigned m_pos; 30 | unsigned m_size; 31 | 32 | unsigned m_row, m_col; 33 | }; 34 | 35 | ostream& operator << (ostream& out, const char *str); 36 | ostream& operator << (ostream& out, const std::string& str); 37 | ostream& operator << (ostream& out, char ch); 38 | } 39 | 40 | #endif // OSTREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 41 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/dll.h" 10 | #include "yaml-cpp/noncopyable.h" 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | struct Directives; 17 | struct Mark; 18 | struct Token; 19 | class EventHandler; 20 | class Node; 21 | class Scanner; 22 | 23 | class YAML_CPP_API Parser: private noncopyable 24 | { 25 | public: 26 | Parser(); 27 | Parser(std::istream& in); 28 | ~Parser(); 29 | 30 | operator bool() const; 31 | 32 | void Load(std::istream& in); 33 | bool HandleNextDocument(EventHandler& eventHandler); 34 | 35 | bool GetNextDocument(Node& document); // old API only 36 | 37 | void PrintTokens(std::ostream& out); 38 | 39 | private: 40 | void ParseDirectives(); 41 | void HandleDirective(const Token& token); 42 | void HandleYamlDirective(const Token& token); 43 | void HandleTagDirective(const Token& token); 44 | 45 | private: 46 | std::auto_ptr m_pScanner; 47 | std::auto_ptr m_pDirectives; 48 | }; 49 | } 50 | 51 | #endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 52 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/stlemitter.h: -------------------------------------------------------------------------------- 1 | #ifndef STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | template 17 | inline Emitter& EmitSeq(Emitter& emitter, const Seq& seq) { 18 | emitter << BeginSeq; 19 | for(typename Seq::const_iterator it=seq.begin();it!=seq.end();++it) 20 | emitter << *it; 21 | emitter << EndSeq; 22 | return emitter; 23 | } 24 | 25 | template 26 | inline Emitter& operator << (Emitter& emitter, const std::vector& v) { 27 | return EmitSeq(emitter, v); 28 | } 29 | 30 | template 31 | inline Emitter& operator << (Emitter& emitter, const std::list& v) { 32 | return EmitSeq(emitter, v); 33 | } 34 | 35 | template 36 | inline Emitter& operator << (Emitter& emitter, const std::set& v) { 37 | return EmitSeq(emitter, v); 38 | } 39 | 40 | template 41 | inline Emitter& operator << (Emitter& emitter, const std::map& m) { 42 | typedef typename std::map map; 43 | emitter << BeginMap; 44 | for(typename map::const_iterator it=m.begin();it!=m.end();++it) 45 | emitter << Key << it->first << Value << it->second; 46 | emitter << EndMap; 47 | return emitter; 48 | } 49 | } 50 | 51 | #endif // STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 52 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/stlnode.h: -------------------------------------------------------------------------------- 1 | #ifndef STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | template 15 | void operator >> (const Node& node, std::vector& v) 16 | { 17 | v.clear(); 18 | v.resize(node.size()); 19 | for(unsigned i=0;i> v[i]; 21 | } 22 | 23 | 24 | template 25 | void operator >> (const Node& node, std::map& m) 26 | { 27 | m.clear(); 28 | for(Iterator it=node.begin();it!=node.end();++it) { 29 | K k; 30 | V v; 31 | it.first() >> k; 32 | it.second() >> v; 33 | m[k] = v; 34 | } 35 | } 36 | } 37 | 38 | #endif // STLNODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 39 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/traits.h: -------------------------------------------------------------------------------- 1 | #ifndef TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | namespace YAML 10 | { 11 | template 12 | struct is_numeric { enum { value = false }; }; 13 | 14 | template <> struct is_numeric { enum { value = true }; }; 15 | template <> struct is_numeric { enum { value = true }; }; 16 | template <> struct is_numeric { enum { value = true }; }; 17 | template <> struct is_numeric { enum { value = true }; }; 18 | template <> struct is_numeric { enum { value = true }; }; 19 | template <> struct is_numeric { enum { value = true }; }; 20 | template <> struct is_numeric { enum { value = true }; }; 21 | template <> struct is_numeric { enum { value = true }; }; 22 | #if defined(_MSC_VER) && (_MSC_VER < 1310) 23 | template <> struct is_numeric <__int64> { enum { value = true }; }; 24 | template <> struct is_numeric { enum { value = true }; }; 25 | #else 26 | template <> struct is_numeric { enum { value = true }; }; 27 | template <> struct is_numeric { enum { value = true }; }; 28 | #endif 29 | template <> struct is_numeric { enum { value = true }; }; 30 | template <> struct is_numeric { enum { value = true }; }; 31 | template <> struct is_numeric { enum { value = true }; }; 32 | 33 | template 34 | struct enable_if_c { 35 | typedef T type; 36 | }; 37 | 38 | template 39 | struct enable_if_c {}; 40 | 41 | template 42 | struct enable_if : public enable_if_c {}; 43 | 44 | template 45 | struct disable_if_c { 46 | typedef T type; 47 | }; 48 | 49 | template 50 | struct disable_if_c {}; 51 | 52 | template 53 | struct disable_if : public disable_if_c {}; 54 | } 55 | 56 | #endif // TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 57 | 58 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/include/yaml-cpp/yaml.h: -------------------------------------------------------------------------------- 1 | #ifndef YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/parser.h" 9 | #include "yaml-cpp/emitter.h" 10 | #include "yaml-cpp/stlemitter.h" 11 | #include "yaml-cpp/exceptions.h" 12 | 13 | #include "yaml-cpp/node.h" 14 | #include "yaml-cpp/stlnode.h" 15 | #include "yaml-cpp/iterator.h" 16 | 17 | #endif // YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 18 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/install.txt: -------------------------------------------------------------------------------- 1 | *** With CMake *** 2 | 3 | yaml-cpp uses CMake to support cross-platform building. In a UNIX-like system, the basic steps to build are: 4 | 5 | 1. Download and install CMake (if you don't have root privileges, just install to a local directory, like ~/bin) 6 | 7 | 2. From the source directory, run: 8 | 9 | mkdir build 10 | cd build 11 | cmake .. 12 | 13 | and then the usual 14 | 15 | make 16 | make install 17 | 18 | 3. To clean up, just remove the 'build' directory. 19 | 20 | *** Without CMake *** 21 | 22 | If you don't want to use CMake, just add all .cpp files to a makefile. yaml-cpp does not need any special build settings, so no 'configure' file is necessary. 23 | 24 | (Note: this is pretty tedious. It's sooo much easier to use CMake.) 25 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008 Jesse Beder. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/aliasmanager.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/aliasmanager.h" 2 | #include "yaml-cpp/node.h" 3 | #include 4 | #include 5 | 6 | namespace YAML 7 | { 8 | AliasManager::AliasManager(): m_curAnchor(0) 9 | { 10 | } 11 | 12 | void AliasManager::RegisterReference(const Node& node) 13 | { 14 | m_anchorByIdentity.insert(std::make_pair(&node, _CreateNewAnchor())); 15 | } 16 | 17 | anchor_t AliasManager::LookupAnchor(const Node& node) const 18 | { 19 | AnchorByIdentity::const_iterator it = m_anchorByIdentity.find(&node); 20 | if(it == m_anchorByIdentity.end()) 21 | return 0; 22 | return it->second; 23 | } 24 | 25 | anchor_t AliasManager::_CreateNewAnchor() 26 | { 27 | return ++m_curAnchor; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/collectionstack.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | struct CollectionType { 15 | enum value { None, BlockMap, BlockSeq, FlowMap, FlowSeq, CompactMap }; 16 | }; 17 | 18 | class CollectionStack 19 | { 20 | public: 21 | CollectionType::value GetCurCollectionType() const { 22 | if(collectionStack.empty()) 23 | return CollectionType::None; 24 | return collectionStack.top(); 25 | } 26 | 27 | void PushCollectionType(CollectionType::value type) { collectionStack.push(type); } 28 | void PopCollectionType(CollectionType::value type) { assert(type == GetCurCollectionType()); collectionStack.pop(); } 29 | 30 | private: 31 | std::stack collectionStack; 32 | }; 33 | } 34 | 35 | #endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 36 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/contrib/graphbuilder.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/parser.h" 2 | #include "yaml-cpp/contrib/graphbuilder.h" 3 | #include "graphbuilderadapter.h" 4 | 5 | namespace YAML 6 | { 7 | void *BuildGraphOfNextDocument(Parser& parser, GraphBuilderInterface& graphBuilder) 8 | { 9 | GraphBuilderAdapter eventHandler(graphBuilder); 10 | if (parser.HandleNextDocument(eventHandler)) { 11 | return eventHandler.RootNode(); 12 | } else { 13 | return NULL; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/contrib/graphbuilderadapter.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include "yaml-cpp/eventhandler.h" 12 | #include "yaml-cpp/contrib/anchordict.h" 13 | #include "yaml-cpp/contrib/graphbuilder.h" 14 | 15 | namespace YAML 16 | { 17 | class GraphBuilderAdapter : public EventHandler 18 | { 19 | public: 20 | GraphBuilderAdapter(GraphBuilderInterface& builder) 21 | : m_builder(builder), m_pRootNode(NULL), m_pKeyNode(NULL) 22 | { 23 | } 24 | 25 | virtual void OnDocumentStart(const Mark& mark) {(void)mark;} 26 | virtual void OnDocumentEnd() {} 27 | 28 | virtual void OnNull(const Mark& mark, anchor_t anchor); 29 | virtual void OnAlias(const Mark& mark, anchor_t anchor); 30 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value); 31 | 32 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor); 33 | virtual void OnSequenceEnd(); 34 | 35 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor); 36 | virtual void OnMapEnd(); 37 | 38 | void *RootNode() const {return m_pRootNode;} 39 | 40 | private: 41 | struct ContainerFrame 42 | { 43 | ContainerFrame(void *pSequence) 44 | : pContainer(pSequence), pPrevKeyNode(&sequenceMarker) 45 | {} 46 | ContainerFrame(void *pMap, void* pPrevKeyNode) 47 | : pContainer(pMap), pPrevKeyNode(pPrevKeyNode) 48 | {} 49 | 50 | void *pContainer; 51 | void *pPrevKeyNode; 52 | 53 | bool isMap() const {return pPrevKeyNode != &sequenceMarker;} 54 | 55 | private: 56 | static int sequenceMarker; 57 | }; 58 | typedef std::stack ContainerStack; 59 | typedef AnchorDict AnchorMap; 60 | 61 | GraphBuilderInterface& m_builder; 62 | ContainerStack m_containers; 63 | AnchorMap m_anchors; 64 | void *m_pRootNode; 65 | void *m_pKeyNode; 66 | 67 | void *GetCurrentParent() const; 68 | void RegisterAnchor(anchor_t anchor, void *pNode); 69 | void DispositionNode(void *pNode); 70 | }; 71 | } 72 | 73 | #endif // GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 74 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/conversion.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/conversion.h" 2 | #include 3 | 4 | //////////////////////////////////////////////////////////////// 5 | // Specializations for converting a string to specific types 6 | 7 | namespace 8 | { 9 | // we're not gonna mess with the mess that is all the isupper/etc. functions 10 | bool IsLower(char ch) { return 'a' <= ch && ch <= 'z'; } 11 | bool IsUpper(char ch) { return 'A' <= ch && ch <= 'Z'; } 12 | char ToLower(char ch) { return IsUpper(ch) ? ch + 'a' - 'A' : ch; } 13 | 14 | std::string tolower(const std::string& str) 15 | { 16 | std::string s(str); 17 | std::transform(s.begin(), s.end(), s.begin(), ToLower); 18 | return s; 19 | } 20 | 21 | template 22 | bool IsEntirely(const std::string& str, T func) 23 | { 24 | for(std::size_t i=0;i::const_iterator it = tags.find(handle); 16 | if(it == tags.end()) { 17 | if(handle == "!!") 18 | return "tag:yaml.org,2002:"; 19 | return handle; 20 | } 21 | 22 | return it->second; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/directives.h: -------------------------------------------------------------------------------- 1 | #ifndef DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | struct Version { 15 | bool isDefault; 16 | int major, minor; 17 | }; 18 | 19 | struct Directives { 20 | Directives(); 21 | 22 | const std::string TranslateTagHandle(const std::string& handle) const; 23 | 24 | Version version; 25 | std::map tags; 26 | }; 27 | } 28 | 29 | #endif // DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 30 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/emitfromevents.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/emitfromevents.h" 2 | #include "yaml-cpp/emitter.h" 3 | #include "yaml-cpp/null.h" 4 | #include 5 | #include 6 | 7 | namespace { 8 | std::string ToString(YAML::anchor_t anchor) { 9 | std::stringstream stream; 10 | stream << anchor; 11 | return stream.str(); 12 | } 13 | } 14 | 15 | namespace YAML 16 | { 17 | EmitFromEvents::EmitFromEvents(Emitter& emitter): m_emitter(emitter) 18 | { 19 | } 20 | 21 | void EmitFromEvents::OnDocumentStart(const Mark&) 22 | { 23 | } 24 | 25 | void EmitFromEvents::OnDocumentEnd() 26 | { 27 | } 28 | 29 | void EmitFromEvents::OnNull(const Mark&, anchor_t anchor) 30 | { 31 | BeginNode(); 32 | EmitProps("", anchor); 33 | m_emitter << Null; 34 | } 35 | 36 | void EmitFromEvents::OnAlias(const Mark&, anchor_t anchor) 37 | { 38 | BeginNode(); 39 | m_emitter << Alias(ToString(anchor)); 40 | } 41 | 42 | void EmitFromEvents::OnScalar(const Mark&, const std::string& tag, anchor_t anchor, const std::string& value) 43 | { 44 | BeginNode(); 45 | EmitProps(tag, anchor); 46 | m_emitter << value; 47 | } 48 | 49 | void EmitFromEvents::OnSequenceStart(const Mark&, const std::string& tag, anchor_t anchor) 50 | { 51 | BeginNode(); 52 | EmitProps(tag, anchor); 53 | m_emitter << BeginSeq; 54 | m_stateStack.push(State::WaitingForSequenceEntry); 55 | } 56 | 57 | void EmitFromEvents::OnSequenceEnd() 58 | { 59 | m_emitter << EndSeq; 60 | assert(m_stateStack.top() == State::WaitingForSequenceEntry); 61 | m_stateStack.pop(); 62 | } 63 | 64 | void EmitFromEvents::OnMapStart(const Mark&, const std::string& tag, anchor_t anchor) 65 | { 66 | BeginNode(); 67 | EmitProps(tag, anchor); 68 | m_emitter << BeginMap; 69 | m_stateStack.push(State::WaitingForKey); 70 | } 71 | 72 | void EmitFromEvents::OnMapEnd() 73 | { 74 | m_emitter << EndMap; 75 | assert(m_stateStack.top() == State::WaitingForKey); 76 | m_stateStack.pop(); 77 | } 78 | 79 | void EmitFromEvents::BeginNode() 80 | { 81 | if(m_stateStack.empty()) 82 | return; 83 | 84 | switch(m_stateStack.top()) { 85 | case State::WaitingForKey: 86 | m_emitter << Key; 87 | m_stateStack.top() = State::WaitingForValue; 88 | break; 89 | case State::WaitingForValue: 90 | m_emitter << Value; 91 | m_stateStack.top() = State::WaitingForKey; 92 | break; 93 | default: 94 | break; 95 | } 96 | } 97 | 98 | void EmitFromEvents::EmitProps(const std::string& tag, anchor_t anchor) 99 | { 100 | if(!tag.empty() && tag != "?") 101 | m_emitter << VerbatimTag(tag); 102 | if(anchor) 103 | m_emitter << Anchor(ToString(anchor)); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/emitterutils.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/ostream.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | class Binary; 15 | 16 | namespace Utils 17 | { 18 | bool WriteString(ostream& out, const std::string& str, bool inFlow, bool escapeNonAscii); 19 | bool WriteSingleQuotedString(ostream& out, const std::string& str); 20 | bool WriteDoubleQuotedString(ostream& out, const std::string& str, bool escapeNonAscii); 21 | bool WriteLiteralString(ostream& out, const std::string& str, int indent); 22 | bool WriteChar(ostream& out, char ch); 23 | bool WriteComment(ostream& out, const std::string& str, int postCommentIndent); 24 | bool WriteAlias(ostream& out, const std::string& str); 25 | bool WriteAnchor(ostream& out, const std::string& str); 26 | bool WriteTag(ostream& out, const std::string& str, bool verbatim); 27 | bool WriteTagWithPrefix(ostream& out, const std::string& prefix, const std::string& tag); 28 | bool WriteBinary(ostream& out, const Binary& binary); 29 | } 30 | } 31 | 32 | #endif // EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 33 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/indentation.h: -------------------------------------------------------------------------------- 1 | #ifndef INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/ostream.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | struct Indentation { 15 | Indentation(unsigned n_): n(n_) {} 16 | unsigned n; 17 | }; 18 | 19 | inline ostream& operator << (ostream& out, const Indentation& indent) { 20 | for(unsigned i=0;i pData): m_pData(pData) 12 | { 13 | } 14 | 15 | Iterator::Iterator(const Iterator& rhs): m_pData(new IterPriv(*rhs.m_pData)) 16 | { 17 | } 18 | 19 | Iterator& Iterator::operator = (const Iterator& rhs) 20 | { 21 | if(this == &rhs) 22 | return *this; 23 | 24 | m_pData.reset(new IterPriv(*rhs.m_pData)); 25 | return *this; 26 | } 27 | 28 | Iterator::~Iterator() 29 | { 30 | } 31 | 32 | Iterator& Iterator::operator ++ () 33 | { 34 | if(m_pData->type == IterPriv::IT_SEQ) 35 | ++m_pData->seqIter; 36 | else if(m_pData->type == IterPriv::IT_MAP) 37 | ++m_pData->mapIter; 38 | 39 | return *this; 40 | } 41 | 42 | Iterator Iterator::operator ++ (int) 43 | { 44 | Iterator temp = *this; 45 | 46 | if(m_pData->type == IterPriv::IT_SEQ) 47 | ++m_pData->seqIter; 48 | else if(m_pData->type == IterPriv::IT_MAP) 49 | ++m_pData->mapIter; 50 | 51 | return temp; 52 | } 53 | 54 | const Node& Iterator::operator * () const 55 | { 56 | if(m_pData->type == IterPriv::IT_SEQ) 57 | return **m_pData->seqIter; 58 | 59 | throw BadDereference(); 60 | } 61 | 62 | const Node *Iterator::operator -> () const 63 | { 64 | if(m_pData->type == IterPriv::IT_SEQ) 65 | return *m_pData->seqIter; 66 | 67 | throw BadDereference(); 68 | } 69 | 70 | const Node& Iterator::first() const 71 | { 72 | if(m_pData->type == IterPriv::IT_MAP) 73 | return *m_pData->mapIter->first; 74 | 75 | throw BadDereference(); 76 | } 77 | 78 | const Node& Iterator::second() const 79 | { 80 | if(m_pData->type == IterPriv::IT_MAP) 81 | return *m_pData->mapIter->second; 82 | 83 | throw BadDereference(); 84 | } 85 | 86 | bool operator == (const Iterator& it, const Iterator& jt) 87 | { 88 | if(it.m_pData->type != jt.m_pData->type) 89 | return false; 90 | 91 | if(it.m_pData->type == IterPriv::IT_SEQ) 92 | return it.m_pData->seqIter == jt.m_pData->seqIter; 93 | else if(it.m_pData->type == IterPriv::IT_MAP) 94 | return it.m_pData->mapIter == jt.m_pData->mapIter; 95 | 96 | return true; 97 | } 98 | 99 | bool operator != (const Iterator& it, const Iterator& jt) 100 | { 101 | return !(it == jt); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/iterpriv.h: -------------------------------------------------------------------------------- 1 | #ifndef ITERPRIV_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ITERPRIV_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/ltnode.h" 10 | #include 11 | #include 12 | 13 | namespace YAML 14 | { 15 | class Node; 16 | 17 | // IterPriv 18 | // . The implementation for iterators - essentially a union of sequence and map iterators. 19 | struct IterPriv 20 | { 21 | IterPriv(): type(IT_NONE) {} 22 | IterPriv(std::vector ::const_iterator it): type(IT_SEQ), seqIter(it) {} 23 | IterPriv(std::map ::const_iterator it): type(IT_MAP), mapIter(it) {} 24 | 25 | enum ITER_TYPE { IT_NONE, IT_SEQ, IT_MAP }; 26 | ITER_TYPE type; 27 | 28 | std::vector ::const_iterator seqIter; 29 | std::map ::const_iterator mapIter; 30 | }; 31 | } 32 | 33 | #endif // ITERPRIV_H_62B23520_7C8E_11DE_8A39_0800200C9A66 34 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/nodebuilder.h: -------------------------------------------------------------------------------- 1 | #ifndef NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/eventhandler.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | class Node; 17 | 18 | class NodeBuilder: public EventHandler 19 | { 20 | public: 21 | explicit NodeBuilder(Node& root); 22 | virtual ~NodeBuilder(); 23 | 24 | virtual void OnDocumentStart(const Mark& mark); 25 | virtual void OnDocumentEnd(); 26 | 27 | virtual void OnNull(const Mark& mark, anchor_t anchor); 28 | virtual void OnAlias(const Mark& mark, anchor_t anchor); 29 | virtual void OnScalar(const Mark& mark, const std::string& tag, anchor_t anchor, const std::string& value); 30 | 31 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, anchor_t anchor); 32 | virtual void OnSequenceEnd(); 33 | 34 | virtual void OnMapStart(const Mark& mark, const std::string& tag, anchor_t anchor); 35 | virtual void OnMapEnd(); 36 | 37 | private: 38 | Node& Push(anchor_t anchor); 39 | Node& Push(); 40 | Node& Top(); 41 | void Pop(); 42 | 43 | void Insert(Node& node); 44 | void RegisterAnchor(anchor_t anchor, Node& node); 45 | 46 | private: 47 | Node& m_root; 48 | bool m_initializedRoot; 49 | bool m_finished; 50 | 51 | std::stack m_stack; 52 | std::stack m_pendingKeys; 53 | std::stack m_didPushKey; 54 | 55 | typedef std::vector Anchors; 56 | Anchors m_anchors; 57 | }; 58 | } 59 | 60 | #endif // NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 61 | 62 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/nodeownership.cpp: -------------------------------------------------------------------------------- 1 | #include "nodeownership.h" 2 | #include "yaml-cpp/node.h" 3 | 4 | namespace YAML 5 | { 6 | NodeOwnership::NodeOwnership(NodeOwnership *pOwner): m_pOwner(pOwner) 7 | { 8 | if(!m_pOwner) 9 | m_pOwner = this; 10 | } 11 | 12 | NodeOwnership::~NodeOwnership() 13 | { 14 | } 15 | 16 | Node& NodeOwnership::_Create() 17 | { 18 | m_nodes.push_back(std::auto_ptr(new Node)); 19 | return m_nodes.back(); 20 | } 21 | 22 | void NodeOwnership::_MarkAsAliased(const Node& node) 23 | { 24 | m_aliasedNodes.insert(&node); 25 | } 26 | 27 | bool NodeOwnership::_IsAliased(const Node& node) const 28 | { 29 | return m_aliasedNodes.count(&node) > 0; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/nodeownership.h: -------------------------------------------------------------------------------- 1 | #ifndef NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/noncopyable.h" 10 | #include "ptr_vector.h" 11 | #include 12 | 13 | namespace YAML 14 | { 15 | class Node; 16 | 17 | class NodeOwnership: private noncopyable 18 | { 19 | public: 20 | explicit NodeOwnership(NodeOwnership *pOwner = 0); 21 | ~NodeOwnership(); 22 | 23 | Node& Create() { return m_pOwner->_Create(); } 24 | void MarkAsAliased(const Node& node) { m_pOwner->_MarkAsAliased(node); } 25 | bool IsAliased(const Node& node) const { return m_pOwner->_IsAliased(node); } 26 | 27 | private: 28 | Node& _Create(); 29 | void _MarkAsAliased(const Node& node); 30 | bool _IsAliased(const Node& node) const; 31 | 32 | private: 33 | ptr_vector m_nodes; 34 | std::set m_aliasedNodes; 35 | NodeOwnership *m_pOwner; 36 | }; 37 | } 38 | 39 | #endif // NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 40 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/null.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/null.h" 2 | #include "yaml-cpp/node.h" 3 | 4 | namespace YAML 5 | { 6 | _Null Null; 7 | 8 | bool IsNull(const Node& node) 9 | { 10 | return node.Read(Null); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/ostream.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/ostream.h" 2 | #include 3 | 4 | namespace YAML 5 | { 6 | ostream::ostream(): m_buffer(0), m_pos(0), m_size(0), m_row(0), m_col(0) 7 | { 8 | reserve(1024); 9 | } 10 | 11 | ostream::~ostream() 12 | { 13 | delete [] m_buffer; 14 | } 15 | 16 | void ostream::reserve(unsigned size) 17 | { 18 | if(size <= m_size) 19 | return; 20 | 21 | char *newBuffer = new char[size]; 22 | std::memset(newBuffer, 0, size * sizeof(char)); 23 | std::memcpy(newBuffer, m_buffer, m_size * sizeof(char)); 24 | delete [] m_buffer; 25 | m_buffer = newBuffer; 26 | m_size = size; 27 | } 28 | 29 | void ostream::put(char ch) 30 | { 31 | if(m_pos >= m_size - 1) // an extra space for the NULL terminator 32 | reserve(m_size * 2); 33 | 34 | m_buffer[m_pos] = ch; 35 | m_pos++; 36 | 37 | if(ch == '\n') { 38 | m_row++; 39 | m_col = 0; 40 | } else 41 | m_col++; 42 | } 43 | 44 | ostream& operator << (ostream& out, const char *str) 45 | { 46 | std::size_t length = std::strlen(str); 47 | for(std::size_t i=0;i= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/noncopyable.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | template 15 | class ptr_stack: private YAML::noncopyable 16 | { 17 | public: 18 | ptr_stack() {} 19 | ~ptr_stack() { clear(); } 20 | 21 | void clear() { 22 | for(unsigned i=0;i t) { 31 | m_data.push_back(NULL); 32 | m_data.back() = t.release(); 33 | } 34 | std::auto_ptr pop() { 35 | std::auto_ptr t(m_data.back()); 36 | m_data.pop_back(); 37 | return t; 38 | } 39 | T& top() { return *m_data.back(); } 40 | const T& top() const { return *m_data.back(); } 41 | 42 | private: 43 | std::vector m_data; 44 | }; 45 | 46 | #endif // PTR_STACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 47 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/ptr_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include "yaml-cpp/noncopyable.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML { 15 | 16 | template 17 | class ptr_vector: private YAML::noncopyable 18 | { 19 | public: 20 | ptr_vector() {} 21 | ~ptr_vector() { clear(); } 22 | 23 | void clear() { 24 | for(unsigned i=0;i t) { 33 | m_data.push_back(NULL); 34 | m_data.back() = t.release(); 35 | } 36 | T& operator[](std::size_t i) { return *m_data[i]; } 37 | const T& operator[](std::size_t i) const { return *m_data[i]; } 38 | 39 | T& back() { return *m_data.back(); } 40 | const T& back() const { return *m_data.back(); } 41 | 42 | private: 43 | std::vector m_data; 44 | }; 45 | } 46 | 47 | #endif // PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 48 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/regex.cpp: -------------------------------------------------------------------------------- 1 | #include "regex.h" 2 | 3 | namespace YAML 4 | { 5 | // constructors 6 | RegEx::RegEx(): m_op(REGEX_EMPTY) 7 | { 8 | } 9 | 10 | RegEx::RegEx(REGEX_OP op): m_op(op) 11 | { 12 | } 13 | 14 | RegEx::RegEx(char ch): m_op(REGEX_MATCH), m_a(ch) 15 | { 16 | } 17 | 18 | RegEx::RegEx(char a, char z): m_op(REGEX_RANGE), m_a(a), m_z(z) 19 | { 20 | } 21 | 22 | RegEx::RegEx(const std::string& str, REGEX_OP op): m_op(op) 23 | { 24 | for(std::size_t i=0;i= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | 12 | namespace YAML 13 | { 14 | class Stream; 15 | 16 | enum REGEX_OP { REGEX_EMPTY, REGEX_MATCH, REGEX_RANGE, REGEX_OR, REGEX_AND, REGEX_NOT, REGEX_SEQ }; 17 | 18 | // simplified regular expressions 19 | // . Only straightforward matches (no repeated characters) 20 | // . Only matches from start of string 21 | class RegEx 22 | { 23 | public: 24 | RegEx(); 25 | RegEx(char ch); 26 | RegEx(char a, char z); 27 | RegEx(const std::string& str, REGEX_OP op = REGEX_SEQ); 28 | ~RegEx() {} 29 | 30 | friend RegEx operator ! (const RegEx& ex); 31 | friend RegEx operator || (const RegEx& ex1, const RegEx& ex2); 32 | friend RegEx operator && (const RegEx& ex1, const RegEx& ex2); 33 | friend RegEx operator + (const RegEx& ex1, const RegEx& ex2); 34 | 35 | bool Matches(char ch) const; 36 | bool Matches(const std::string& str) const; 37 | bool Matches(const Stream& in) const; 38 | template bool Matches(const Source& source) const; 39 | 40 | int Match(const std::string& str) const; 41 | int Match(const Stream& in) const; 42 | template int Match(const Source& source) const; 43 | 44 | private: 45 | RegEx(REGEX_OP op); 46 | 47 | template bool IsValidSource(const Source& source) const; 48 | template int MatchUnchecked(const Source& source) const; 49 | 50 | template int MatchOpEmpty(const Source& source) const; 51 | template int MatchOpMatch(const Source& source) const; 52 | template int MatchOpRange(const Source& source) const; 53 | template int MatchOpOr(const Source& source) const; 54 | template int MatchOpAnd(const Source& source) const; 55 | template int MatchOpNot(const Source& source) const; 56 | template int MatchOpSeq(const Source& source) const; 57 | 58 | private: 59 | REGEX_OP m_op; 60 | char m_a, m_z; 61 | std::vector m_params; 62 | }; 63 | } 64 | 65 | #include "regeximpl.h" 66 | 67 | #endif // REGEX_H_62B23520_7C8E_11DE_8A39_0800200C9A66 68 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/scanscalar.h: -------------------------------------------------------------------------------- 1 | #ifndef SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include "regex.h" 11 | #include "stream.h" 12 | 13 | namespace YAML 14 | { 15 | enum CHOMP { STRIP = -1, CLIP, KEEP }; 16 | enum ACTION { NONE, BREAK, THROW }; 17 | enum FOLD { DONT_FOLD, FOLD_BLOCK, FOLD_FLOW }; 18 | 19 | struct ScanScalarParams { 20 | ScanScalarParams(): eatEnd(false), indent(0), detectIndent(false), eatLeadingWhitespace(0), escape(0), fold(DONT_FOLD), 21 | trimTrailingSpaces(0), chomp(CLIP), onDocIndicator(NONE), onTabInIndentation(NONE), leadingSpaces(false) {} 22 | 23 | // input: 24 | RegEx end; // what condition ends this scalar? 25 | bool eatEnd; // should we eat that condition when we see it? 26 | int indent; // what level of indentation should be eaten and ignored? 27 | bool detectIndent; // should we try to autodetect the indent? 28 | bool eatLeadingWhitespace; // should we continue eating this delicious indentation after 'indent' spaces? 29 | char escape; // what character do we escape on (i.e., slash or single quote) (0 for none) 30 | FOLD fold; // how do we fold line ends? 31 | bool trimTrailingSpaces; // do we remove all trailing spaces (at the very end) 32 | CHOMP chomp; // do we strip, clip, or keep trailing newlines (at the very end) 33 | // Note: strip means kill all, clip means keep at most one, keep means keep all 34 | ACTION onDocIndicator; // what do we do if we see a document indicator? 35 | ACTION onTabInIndentation; // what do we do if we see a tab where we should be seeing indentation spaces 36 | 37 | // output: 38 | bool leadingSpaces; 39 | }; 40 | 41 | std::string ScanScalar(Stream& INPUT, ScanScalarParams& info); 42 | } 43 | 44 | #endif // SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 45 | 46 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/scantag.cpp: -------------------------------------------------------------------------------- 1 | #include "scanner.h" 2 | #include "regex.h" 3 | #include "exp.h" 4 | #include "yaml-cpp/exceptions.h" 5 | 6 | namespace YAML 7 | { 8 | const std::string ScanVerbatimTag(Stream& INPUT) 9 | { 10 | std::string tag; 11 | 12 | // eat the start character 13 | INPUT.get(); 14 | 15 | while(INPUT) { 16 | if(INPUT.peek() == Keys::VerbatimTagEnd) { 17 | // eat the end character 18 | INPUT.get(); 19 | return tag; 20 | } 21 | 22 | int n = Exp::URI().Match(INPUT); 23 | if(n <= 0) 24 | break; 25 | 26 | tag += INPUT.get(n); 27 | } 28 | 29 | throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG); 30 | } 31 | 32 | const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) 33 | { 34 | std::string tag; 35 | canBeHandle = true; 36 | Mark firstNonWordChar; 37 | 38 | while(INPUT) { 39 | if(INPUT.peek() == Keys::Tag) { 40 | if(!canBeHandle) 41 | throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE); 42 | break; 43 | } 44 | 45 | int n = 0; 46 | if(canBeHandle) { 47 | n = Exp::Word().Match(INPUT); 48 | if(n <= 0) { 49 | canBeHandle = false; 50 | firstNonWordChar = INPUT.mark(); 51 | } 52 | } 53 | 54 | if(!canBeHandle) 55 | n = Exp::Tag().Match(INPUT); 56 | 57 | if(n <= 0) 58 | break; 59 | 60 | tag += INPUT.get(n); 61 | } 62 | 63 | return tag; 64 | } 65 | 66 | const std::string ScanTagSuffix(Stream& INPUT) 67 | { 68 | std::string tag; 69 | 70 | while(INPUT) { 71 | int n = Exp::Tag().Match(INPUT); 72 | if(n <= 0) 73 | break; 74 | 75 | tag += INPUT.get(n); 76 | } 77 | 78 | if(tag.empty()) 79 | throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX); 80 | 81 | return tag; 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/scantag.h: -------------------------------------------------------------------------------- 1 | #ifndef SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include "stream.h" 11 | 12 | namespace YAML 13 | { 14 | const std::string ScanVerbatimTag(Stream& INPUT); 15 | const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle); 16 | const std::string ScanTagSuffix(Stream& INPUT); 17 | } 18 | 19 | #endif // SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 20 | 21 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/setting.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | #include 11 | #include "yaml-cpp/noncopyable.h" 12 | 13 | namespace YAML 14 | { 15 | class SettingChangeBase; 16 | 17 | template 18 | class Setting 19 | { 20 | public: 21 | Setting(): m_value() {} 22 | 23 | const T get() const { return m_value; } 24 | std::auto_ptr set(const T& value); 25 | void restore(const Setting& oldSetting) { 26 | m_value = oldSetting.get(); 27 | } 28 | 29 | private: 30 | T m_value; 31 | }; 32 | 33 | class SettingChangeBase 34 | { 35 | public: 36 | virtual ~SettingChangeBase() {} 37 | virtual void pop() = 0; 38 | }; 39 | 40 | template 41 | class SettingChange: public SettingChangeBase 42 | { 43 | public: 44 | SettingChange(Setting *pSetting): m_pCurSetting(pSetting) { 45 | // copy old setting to save its state 46 | m_oldSetting = *pSetting; 47 | } 48 | 49 | virtual void pop() { 50 | m_pCurSetting->restore(m_oldSetting); 51 | } 52 | 53 | private: 54 | Setting *m_pCurSetting; 55 | Setting m_oldSetting; 56 | }; 57 | 58 | template 59 | inline std::auto_ptr Setting::set(const T& value) { 60 | std::auto_ptr pChange(new SettingChange (this)); 61 | m_value = value; 62 | return pChange; 63 | } 64 | 65 | class SettingChanges: private noncopyable 66 | { 67 | public: 68 | SettingChanges() {} 69 | ~SettingChanges() { clear(); } 70 | 71 | void clear() { 72 | restore(); 73 | 74 | for(setting_changes::const_iterator it=m_settingChanges.begin();it!=m_settingChanges.end();++it) 75 | delete *it; 76 | m_settingChanges.clear(); 77 | } 78 | 79 | void restore() { 80 | for(setting_changes::const_iterator it=m_settingChanges.begin();it!=m_settingChanges.end();++it) 81 | (*it)->pop(); 82 | } 83 | 84 | void push(std::auto_ptr pSettingChange) { 85 | m_settingChanges.push_back(pSettingChange.release()); 86 | } 87 | 88 | // like std::auto_ptr - assignment is transfer of ownership 89 | SettingChanges& operator = (SettingChanges& rhs) { 90 | if(this == &rhs) 91 | return *this; 92 | 93 | clear(); 94 | m_settingChanges = rhs.m_settingChanges; 95 | rhs.m_settingChanges.clear(); 96 | return *this; 97 | } 98 | 99 | private: 100 | typedef std::vector setting_changes; 101 | setting_changes m_settingChanges; 102 | }; 103 | } 104 | 105 | #endif // SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 106 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/singledocparser.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/anchor.h" 10 | #include "yaml-cpp/noncopyable.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML 16 | { 17 | struct Directives; 18 | struct Mark; 19 | struct Token; 20 | class CollectionStack; 21 | class EventHandler; 22 | class Node; 23 | class Scanner; 24 | 25 | class SingleDocParser: private noncopyable 26 | { 27 | public: 28 | SingleDocParser(Scanner& scanner, const Directives& directives); 29 | ~SingleDocParser(); 30 | 31 | void HandleDocument(EventHandler& eventHandler); 32 | 33 | private: 34 | void HandleNode(EventHandler& eventHandler); 35 | 36 | void HandleSequence(EventHandler& eventHandler); 37 | void HandleBlockSequence(EventHandler& eventHandler); 38 | void HandleFlowSequence(EventHandler& eventHandler); 39 | 40 | void HandleMap(EventHandler& eventHandler); 41 | void HandleBlockMap(EventHandler& eventHandler); 42 | void HandleFlowMap(EventHandler& eventHandler); 43 | void HandleCompactMap(EventHandler& eventHandler); 44 | void HandleCompactMapWithNoKey(EventHandler& eventHandler); 45 | 46 | void ParseProperties(std::string& tag, anchor_t& anchor); 47 | void ParseTag(std::string& tag); 48 | void ParseAnchor(anchor_t& anchor); 49 | 50 | anchor_t RegisterAnchor(const std::string& name); 51 | anchor_t LookupAnchor(const Mark& mark, const std::string& name) const; 52 | 53 | private: 54 | Scanner& m_scanner; 55 | const Directives& m_directives; 56 | std::auto_ptr m_pCollectionStack; 57 | 58 | typedef std::map Anchors; 59 | Anchors m_anchors; 60 | 61 | anchor_t m_curAnchor; 62 | }; 63 | } 64 | 65 | #endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 66 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/stream.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/noncopyable.h" 10 | #include "yaml-cpp/mark.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | namespace YAML 19 | { 20 | class Stream: private noncopyable 21 | { 22 | public: 23 | friend class StreamCharSource; 24 | 25 | Stream(std::istream& input); 26 | ~Stream(); 27 | 28 | operator bool() const; 29 | bool operator !() const { return !static_cast (*this); } 30 | 31 | char peek() const; 32 | char get(); 33 | std::string get(int n); 34 | void eat(int n = 1); 35 | 36 | static char eof() { return 0x04; } 37 | 38 | const Mark mark() const { return m_mark; } 39 | int pos() const { return m_mark.pos; } 40 | int line() const { return m_mark.line; } 41 | int column() const { return m_mark.column; } 42 | void ResetColumn() { m_mark.column = 0; } 43 | 44 | private: 45 | enum CharacterSet {utf8, utf16le, utf16be, utf32le, utf32be}; 46 | 47 | std::istream& m_input; 48 | Mark m_mark; 49 | 50 | CharacterSet m_charSet; 51 | mutable std::deque m_readahead; 52 | unsigned char* const m_pPrefetched; 53 | mutable size_t m_nPrefetchedAvailable; 54 | mutable size_t m_nPrefetchedUsed; 55 | 56 | void AdvanceCurrent(); 57 | char CharAt(size_t i) const; 58 | bool ReadAheadTo(size_t i) const; 59 | bool _ReadAheadTo(size_t i) const; 60 | void StreamInUtf8() const; 61 | void StreamInUtf16() const; 62 | void StreamInUtf32() const; 63 | unsigned char GetNextByte() const; 64 | }; 65 | 66 | // CharAt 67 | // . Unchecked access 68 | inline char Stream::CharAt(size_t i) const { 69 | return m_readahead[i]; 70 | } 71 | 72 | inline bool Stream::ReadAheadTo(size_t i) const { 73 | if(m_readahead.size() > i) 74 | return true; 75 | return _ReadAheadTo(i); 76 | } 77 | } 78 | 79 | #endif // STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 80 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/streamcharsource.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/noncopyable.h" 10 | #include 11 | 12 | namespace YAML 13 | { 14 | class StreamCharSource 15 | { 16 | public: 17 | StreamCharSource(const Stream& stream): m_offset(0), m_stream(stream) {} 18 | StreamCharSource(const StreamCharSource& source): m_offset(source.m_offset), m_stream(source.m_stream) {} 19 | ~StreamCharSource() {} 20 | 21 | operator bool() const; 22 | char operator [] (std::size_t i) const { return m_stream.CharAt(m_offset + i); } 23 | bool operator !() const { return !static_cast(*this); } 24 | 25 | const StreamCharSource operator + (int i) const; 26 | 27 | private: 28 | std::size_t m_offset; 29 | const Stream& m_stream; 30 | 31 | StreamCharSource& operator = (const StreamCharSource&); // non-assignable 32 | }; 33 | 34 | inline StreamCharSource::operator bool() const { 35 | return m_stream.ReadAheadTo(m_offset); 36 | } 37 | 38 | inline const StreamCharSource StreamCharSource::operator + (int i) const { 39 | StreamCharSource source(*this); 40 | if(static_cast (source.m_offset) + i >= 0) 41 | source.m_offset += i; 42 | else 43 | source.m_offset = 0; 44 | return source; 45 | } 46 | } 47 | 48 | #endif // STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 49 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/stringsource.h: -------------------------------------------------------------------------------- 1 | #ifndef STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include 10 | 11 | namespace YAML 12 | { 13 | class StringCharSource 14 | { 15 | public: 16 | StringCharSource(const char *str, std::size_t size): m_str(str), m_size(size), m_offset(0) {} 17 | 18 | operator bool() const { return m_offset < m_size; } 19 | char operator [] (std::size_t i) const { return m_str[m_offset + i]; } 20 | bool operator !() const { return !static_cast(*this); } 21 | 22 | const StringCharSource operator + (int i) const { 23 | StringCharSource source(*this); 24 | if(static_cast (source.m_offset) + i >= 0) 25 | source.m_offset += i; 26 | else 27 | source.m_offset = 0; 28 | return source; 29 | } 30 | 31 | StringCharSource& operator ++ () { 32 | ++m_offset; 33 | return *this; 34 | } 35 | 36 | StringCharSource& operator += (std::size_t offset) { 37 | m_offset += offset; 38 | return *this; 39 | } 40 | private: 41 | const char *m_str; 42 | std::size_t m_size; 43 | std::size_t m_offset; 44 | }; 45 | } 46 | 47 | #endif // STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 48 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/tag.cpp: -------------------------------------------------------------------------------- 1 | #include "tag.h" 2 | #include "directives.h" 3 | #include "token.h" 4 | #include 5 | #include 6 | 7 | namespace YAML 8 | { 9 | Tag::Tag(const Token& token): type(static_cast(token.data)) 10 | { 11 | switch(type) { 12 | case VERBATIM: 13 | value = token.value; 14 | break; 15 | case PRIMARY_HANDLE: 16 | value = token.value; 17 | break; 18 | case SECONDARY_HANDLE: 19 | value = token.value; 20 | break; 21 | case NAMED_HANDLE: 22 | handle = token.value; 23 | value = token.params[0]; 24 | break; 25 | case NON_SPECIFIC: 26 | break; 27 | default: 28 | assert(false); 29 | } 30 | } 31 | 32 | const std::string Tag::Translate(const Directives& directives) 33 | { 34 | switch(type) { 35 | case VERBATIM: 36 | return value; 37 | case PRIMARY_HANDLE: 38 | return directives.TranslateTagHandle("!") + value; 39 | case SECONDARY_HANDLE: 40 | return directives.TranslateTagHandle("!!") + value; 41 | case NAMED_HANDLE: 42 | return directives.TranslateTagHandle("!" + handle + "!") + value; 43 | case NON_SPECIFIC: 44 | // TODO: 45 | return "!"; 46 | default: 47 | assert(false); 48 | } 49 | throw std::runtime_error("yaml-cpp: internal error, bad tag type"); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/tag.h: -------------------------------------------------------------------------------- 1 | #ifndef TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | 10 | namespace YAML 11 | { 12 | struct Token; 13 | struct Directives; 14 | 15 | struct Tag { 16 | enum TYPE { 17 | VERBATIM, PRIMARY_HANDLE, SECONDARY_HANDLE, NAMED_HANDLE, NON_SPECIFIC 18 | }; 19 | 20 | Tag(const Token& token); 21 | const std::string Translate(const Directives& directives); 22 | 23 | TYPE type; 24 | std::string handle, value; 25 | }; 26 | } 27 | 28 | #endif // TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 29 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/src/token.h: -------------------------------------------------------------------------------- 1 | #ifndef TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | 9 | #include "yaml-cpp/mark.h" 10 | #include 11 | #include 12 | #include 13 | 14 | namespace YAML 15 | { 16 | const std::string TokenNames[] = { 17 | "DIRECTIVE", 18 | "DOC_START", 19 | "DOC_END", 20 | "BLOCK_SEQ_START", 21 | "BLOCK_MAP_START", 22 | "BLOCK_SEQ_END", 23 | "BLOCK_MAP_END", 24 | "BLOCK_ENTRY", 25 | "FLOW_SEQ_START", 26 | "FLOW_MAP_START", 27 | "FLOW_SEQ_END", 28 | "FLOW_MAP_END", 29 | "FLOW_MAP_COMPACT", 30 | "FLOW_ENTRY", 31 | "KEY", 32 | "VALUE", 33 | "ANCHOR", 34 | "ALIAS", 35 | "TAG", 36 | "SCALAR" 37 | }; 38 | 39 | struct Token { 40 | // enums 41 | enum STATUS { VALID, INVALID, UNVERIFIED }; 42 | enum TYPE { 43 | DIRECTIVE, 44 | DOC_START, 45 | DOC_END, 46 | BLOCK_SEQ_START, 47 | BLOCK_MAP_START, 48 | BLOCK_SEQ_END, 49 | BLOCK_MAP_END, 50 | BLOCK_ENTRY, 51 | FLOW_SEQ_START, 52 | FLOW_MAP_START, 53 | FLOW_SEQ_END, 54 | FLOW_MAP_END, 55 | FLOW_MAP_COMPACT, 56 | FLOW_ENTRY, 57 | KEY, 58 | VALUE, 59 | ANCHOR, 60 | ALIAS, 61 | TAG, 62 | PLAIN_SCALAR, 63 | NON_PLAIN_SCALAR 64 | }; 65 | 66 | // data 67 | Token(TYPE type_, const Mark& mark_): status(VALID), type(type_), mark(mark_), data(0) {} 68 | 69 | friend std::ostream& operator << (std::ostream& out, const Token& token) { 70 | out << TokenNames[token.type] << std::string(": ") << token.value; 71 | for(std::size_t i=0;i params; 81 | int data; 82 | }; 83 | } 84 | 85 | #endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 86 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_headers [a-z]*.h) 2 | file(GLOB test_sources [a-z]*.cpp) 3 | file(GLOB test_old_api_sources old-api/[a-z]*.cpp) 4 | 5 | list(APPEND test_sources ${test_old_api_sources}) 6 | 7 | include_directories(${YAML_CPP_SOURCE_DIR}/test) 8 | 9 | add_executable(run-tests 10 | ${test_sources} 11 | ${test_headers} 12 | ) 13 | target_link_libraries(run-tests yaml-cpp) 14 | 15 | add_test(yaml-reader-test run-tests) 16 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/test/emittertests.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITTERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITTERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | namespace Test { 9 | bool RunEmitterTests(); 10 | } 11 | 12 | #endif // EMITTERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 13 | 14 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/test/main.cpp: -------------------------------------------------------------------------------- 1 | #include "tests.h" 2 | 3 | int main() 4 | { 5 | Test::RunAll(); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/test/nodetests.h: -------------------------------------------------------------------------------- 1 | #ifndef NODETESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODETESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | namespace Test { 9 | bool RunNodeTests(); 10 | } 11 | 12 | #endif // NODETESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A6666 13 | 14 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/test/parsertests.h: -------------------------------------------------------------------------------- 1 | #ifndef PARSERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define PARSERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | namespace Test { 9 | bool RunParserTests(); 10 | } 11 | 12 | #endif // PARSERTESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 13 | 14 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/test/tests.cpp: -------------------------------------------------------------------------------- 1 | #include "tests.h" 2 | #include "emittertests.h" 3 | #include "nodetests.h" 4 | #include "parsertests.h" 5 | #include "spectests.h" 6 | #include "yaml-cpp/yaml.h" 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace Test 13 | { 14 | void RunAll() 15 | { 16 | bool passed = true; 17 | if(!RunParserTests()) 18 | passed = false; 19 | 20 | if(!RunEmitterTests()) 21 | passed = false; 22 | 23 | if(!RunSpecTests()) 24 | passed = false; 25 | 26 | if(passed) 27 | std::cout << "All tests passed!\n"; 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/test/tests.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 5 | #pragma once 6 | #endif 7 | 8 | #include 9 | 10 | namespace Test { 11 | void RunAll(); 12 | 13 | namespace Parser { 14 | // scalar tests 15 | void SimpleScalar(std::string& inputScalar, std::string& desiredOutput); 16 | void MultiLineScalar(std::string& inputScalar, std::string& desiredOutput); 17 | void LiteralScalar(std::string& inputScalar, std::string& desiredOutput); 18 | void FoldedScalar(std::string& inputScalar, std::string& desiredOutput); 19 | void ChompedFoldedScalar(std::string& inputScalar, std::string& desiredOutput); 20 | void ChompedLiteralScalar(std::string& inputScalar, std::string& desiredOutput); 21 | void FoldedScalarWithIndent(std::string& inputScalar, std::string& desiredOutput); 22 | void ColonScalar(std::string& inputScalar, std::string& desiredOutput); 23 | void QuotedScalar(std::string& inputScalar, std::string& desiredOutput); 24 | void CommaScalar(std::string& inputScalar, std::string& desiredOutput); 25 | void DashScalar(std::string& inputScalar, std::string& desiredOutput); 26 | void URLScalar(std::string& inputScalar, std::string& desiredOutput); 27 | 28 | // misc tests 29 | bool SimpleSeq(); 30 | bool SimpleMap(); 31 | bool FlowSeq(); 32 | bool FlowMap(); 33 | bool FlowMapWithOmittedKey(); 34 | bool FlowMapWithOmittedValue(); 35 | bool FlowMapWithSoloEntry(); 36 | bool FlowMapEndingWithSoloEntry(); 37 | bool QuotedSimpleKeys(); 38 | bool CompressedMapAndSeq(); 39 | bool NullBlockSeqEntry(); 40 | bool NullBlockMapKey(); 41 | bool NullBlockMapValue(); 42 | bool SimpleAlias(); 43 | bool AliasWithNull(); 44 | bool AnchorInSimpleKey(); 45 | bool AliasAsSimpleKey(); 46 | bool ExplicitDoc(); 47 | bool MultipleDocs(); 48 | bool ExplicitEndDoc(); 49 | bool MultipleDocsWithSomeExplicitIndicators(); 50 | } 51 | } 52 | 53 | #endif // TESTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 54 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(parse parse.cpp) 2 | target_link_libraries(parse yaml-cpp) 3 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/util/parse.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/yaml.h" 2 | #include "yaml-cpp/eventhandler.h" 3 | #include 4 | #include 5 | #include 6 | 7 | struct Params { 8 | bool hasFile; 9 | std::string fileName; 10 | }; 11 | 12 | Params ParseArgs(int argc, char **argv) { 13 | Params p; 14 | 15 | std::vector args(argv + 1, argv + argc); 16 | 17 | return p; 18 | } 19 | 20 | class NullEventHandler: public YAML::EventHandler 21 | { 22 | public: 23 | virtual void OnDocumentStart(const YAML::Mark&) {} 24 | virtual void OnDocumentEnd() {} 25 | 26 | virtual void OnNull(const YAML::Mark&, YAML::anchor_t) {} 27 | virtual void OnAlias(const YAML::Mark&, YAML::anchor_t) {} 28 | virtual void OnScalar(const YAML::Mark&, const std::string&, YAML::anchor_t, const std::string&) {} 29 | 30 | virtual void OnSequenceStart(const YAML::Mark&, const std::string&, YAML::anchor_t) {} 31 | virtual void OnSequenceEnd() {} 32 | 33 | virtual void OnMapStart(const YAML::Mark&, const std::string&, YAML::anchor_t) {} 34 | virtual void OnMapEnd() {} 35 | }; 36 | 37 | void parse(std::istream& input) 38 | { 39 | try { 40 | YAML::Parser parser(input); 41 | YAML::Node doc; 42 | while(parser.GetNextDocument(doc)) { 43 | YAML::Emitter emitter; 44 | emitter << doc; 45 | std::cout << emitter.c_str() << "\n"; 46 | } 47 | } catch(const YAML::Exception& e) { 48 | std::cerr << e.what() << "\n"; 49 | } 50 | } 51 | 52 | int main(int argc, char **argv) 53 | { 54 | Params p = ParseArgs(argc, argv); 55 | 56 | if(argc > 1) { 57 | std::ifstream fin; 58 | fin.open(argv[1]); 59 | parse(fin); 60 | } else { 61 | parse(std::cin); 62 | } 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /contrib/yaml-cpp/yaml-cpp.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=${prefix}/@LIB_INSTALL_DIR@ 4 | includedir=${prefix}/@INCLUDE_INSTALL_ROOT_DIR@ 5 | 6 | Name: Yaml-cpp 7 | Description: A YAML parser and emitter for C++ 8 | Version: @YAML_CPP_VERSION@ 9 | Requires: 10 | Libs: -L${libdir} -lyaml-cpp 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /m4/fncs_check_func.m4: -------------------------------------------------------------------------------- 1 | # FNCS_CHECK_FUNCS(FUNCTION..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2 | # ------------------------------------------------------------------------ 3 | # Inspired by 4 | # http://pdh11.blogspot.com/2009/04/standard-macros-available-in-gnu.html 5 | # but really a modified version of AC_CHECK_FUNCS. 6 | AC_DEFUN([FNCS_CHECK_FUNCS], 7 | [m4_map_args_w([$1], [_AH_CHECK_FUNC(], [)])]dnl 8 | [AS_FOR([AC_func], [ac_func], [$1], 9 | [AC_CHECK_FUNC(AC_func, 10 | [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]AC_func), 1, 11 | [Define to 1 if you have the `]AC_func[' function, 0 if you don't]) $2], 12 | [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]AC_func), 0, 13 | [Define to 1 if you have the `]AC_func[' function, 0 if you don't]) $3], [$4])dnl]) 14 | ])# FNCS_CHECK_FUNCS 15 | 16 | # FNCS_SEARCH_LIBS(FUNCTION, LIBRARIES..., 17 | # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 18 | # ------------------------------------------------------------------------ 19 | # Inspired by 20 | # http://pdh11.blogspot.com/2009/04/standard-macros-available-in-gnu.html 21 | # but really a wrapped version of AC_SEARCH_LIBS. 22 | AC_DEFUN([FNCS_SEARCH_LIBS], [ 23 | AS_VAR_PUSHDEF([HAVE_FUNC], m4_toupper(m4_translit([$1], [-.], [__]))) 24 | AC_SEARCH_LIBS([$1], [$2], 25 | [AC_DEFINE([HAVE_FUNC], [1], [Define to 1 if you have the `$1' function.]) 26 | $3], 27 | [AC_DEFINE([HAVE_FUNC], [0], [Define to 1 if you have the `$1' function.]) 28 | $4]) 29 | AS_VAR_POPDEF([HAVE_FUNC]) 30 | ]) # FNCS_SEARCH_LIBS 31 | 32 | -------------------------------------------------------------------------------- /m4/fncs_check_header.m4: -------------------------------------------------------------------------------- 1 | # FNCS_CHECK_HEADERS(HEADER-FILE..., 2 | # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [INCLUDES]) 3 | # ---------------------------------------------------------------------- 4 | # Inspired by 5 | # http://pdh11.blogspot.com/2009/04/standard-macros-available-in-gnu.html 6 | # but really a modified version of AC_CHECK_HEADERS. 7 | AC_DEFUN([FNCS_CHECK_HEADERS], 8 | [m4_map_args_w([$1], [_AH_CHECK_HEADER(], [)])]dnl 9 | [AS_FOR([AC_header], [ac_header], [$1], 10 | [AC_CHECK_HEADER(AC_header, 11 | [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]AC_header), 1, 12 | [Define to 1 if you have the <]AC_header[> header file, 0 if you don't]) $2], 13 | [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_]AC_header), 0, 14 | [Define to 1 if you have the <]AC_header[> header file, 0 if you don't]) $3], [$4])dnl]) 15 | ])# FNCS_CHECK_HEADERS 16 | -------------------------------------------------------------------------------- /m4/fncs_check_package.m4: -------------------------------------------------------------------------------- 1 | # FNCS_CHECK_PACKAGE(pkg, header, library, function, [extra-libs], 2 | # [action-if-found], [action-if-not-found]) 3 | # -------------------------------------------------------------- 4 | # 5 | AC_DEFUN([FNCS_CHECK_PACKAGE], [ 6 | AS_VAR_PUSHDEF([HAVE_PKG], m4_toupper(m4_translit([HAVE_$1], [-.], [__]))) 7 | AS_VAR_PUSHDEF([PKG_LIBS], m4_toupper(m4_translit([$1_LIBS], [-.], [__]))) 8 | AS_VAR_PUSHDEF([PKG_LDFLAGS], m4_toupper(m4_translit([$1_LDFLAGS], [-.], [__]))) 9 | AS_VAR_PUSHDEF([PKG_CPPFLAGS],m4_toupper(m4_translit([$1_CPPFLAGS], [-.], [__]))) 10 | AS_VAR_SET([PKG_LIBS],[]) 11 | AS_VAR_SET([PKG_LDFLAGS],[]) 12 | AS_VAR_SET([PKG_CPPFLAGS],[]) 13 | AC_ARG_WITH([$1], 14 | [AS_HELP_STRING([--with-$1[[=ARG]]], 15 | [specify location of $1 install and/or other flags])], 16 | [], 17 | [with_$1=yes]) 18 | AS_CASE([$with_$1], 19 | [yes], [], 20 | [no], [], 21 | [FNCS_ARG_PARSE( 22 | [with_$1], 23 | [PKG_LIBS], 24 | [PKG_LDFLAGS], 25 | [PKG_CPPFLAGS])]) 26 | happy_header=no 27 | # Check for header. 28 | fncs_check_package_save_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$CPPFLAGS $PKG_CPPFLAGS" 29 | AC_CHECK_HEADER([$2], [happy_header=yes], [$7]) 30 | CPPFLAGS="$fncs_check_package_save_CPPFLAGS" 31 | happy_lib=no 32 | # Check for library. 33 | fncs_check_package_save_LIBS="$LIBS"; LIBS="$PKG_LIBS $LIBS" 34 | fncs_check_package_save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LDFLAGS $PKG_LDFLAGS" 35 | AC_SEARCH_LIBS([$4], [$3], [happy_lib=yes], [], [$5]) 36 | LIBS="$fncs_check_package_save_LIBS" 37 | LDFLAGS="$fncs_check_package_save_LDFLAGS" 38 | AS_CASE([$ac_cv_search_$4], 39 | [*none*], [], 40 | [no], [], 41 | [AS_VAR_APPEND([PKG_LIBS], [$ac_cv_search_$4])]) 42 | AS_IF([test "x$happy_header" = xyes && test "x$happy_lib" = xyes], 43 | [$6 44 | AC_DEFINE([HAVE_PKG], [1], [set to 1 if we have the indicated package]) 45 | AC_SUBST(PKG_LIBS) 46 | AC_SUBST(PKG_LDFLAGS) 47 | AC_SUBST(PKG_CPPFLAGS) 48 | ], 49 | [$7]) 50 | AM_CONDITIONAL(HAVE_PKG, [test "x$happy_header" = xyes && test "x$happy_lib" = xyes]) 51 | AS_VAR_POPDEF([HAVE_PKG]) 52 | AS_VAR_POPDEF([PKG_LIBS]) 53 | AS_VAR_POPDEF([PKG_LDFLAGS]) 54 | AS_VAR_POPDEF([PKG_CPPFLAGS]) 55 | ])dnl 56 | -------------------------------------------------------------------------------- /m4/fncs_cxx_nullptr.m4: -------------------------------------------------------------------------------- 1 | # FNCS_CXX_NULLPTR 2 | # ---------------- 3 | # Check whether CXX has defined nullptr and attempt a substitute if not found. 4 | AC_DEFUN([FNCS_CXX_NULLPTR], [ 5 | AC_LANG_ASSERT([C++]) 6 | AC_CACHE_CHECK([for C++ nullptr], 7 | [fncs_cv_cxx_nullptr], 8 | [AC_LINK_IFELSE( 9 | [AC_LANG_PROGRAM([], [[int *address=nullptr;]])], 10 | [fncs_cv_cxx_nullptr=yes], 11 | [fncs_cv_cxx_nullptr=no])]) 12 | AS_IF([test "x$fncs_cv_cxx_nullptr" = xno], 13 | [AC_DEFINE([nullptr], [0], [if nullptr is not defined, attempt a substitute])]) 14 | ])# FNCS_CXX_NULLPTR 15 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 4179 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) 16 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.6' 20 | macro_revision='2.4.6' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /matlab/.gitignore: -------------------------------------------------------------------------------- 1 | *.mexmaci64 2 | -------------------------------------------------------------------------------- /matlab/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # locate correct mex program 4 | if test "x$MEX" = x 5 | then 6 | MEX=`which mex` 7 | fi 8 | 9 | if $MEX --version > /dev/null 2>&1 10 | then 11 | echo "$MEX is the pdfTeX tool, not the MATLAB MEX compiler" 12 | echo "please update your PATH to locate MATLAB's MEX compiler" 13 | exit 1 14 | fi 15 | 16 | if test "x$FNCS_PREFIX" != x 17 | then 18 | CPPFLAGS="$CPPFLAGS -I$FNCS_PREFIX/include" 19 | LDFLAGS="$LDFLAGS -L$FNCS_PREFIX/lib" 20 | LIBS="$LIBS -lfncs" 21 | echo "FNCS_PREFIX set to $FNCS_PREFIX" 22 | fi 23 | echo "CPPFLAGS=$CPPFLAGS" 24 | echo " LDFLAGS=$LDFLAGS" 25 | echo " LIBS=$LIBS" 26 | 27 | # what suffix does mex add? 28 | rm -f conftest.cpp 29 | cat << EOF > conftest.cpp 30 | #include "mex.h" 31 | void mexFunction( int nlhs, mxArray *plhs[], 32 | int nrhs, const mxArray *prhs[] ) 33 | { 34 | } 35 | EOF 36 | 37 | if $MEX conftest.cpp > /dev/null 2>&1 38 | then 39 | echo "mex test file compiled successfully" 40 | else 41 | echo "unable to compile test file" 42 | rm -f conftest.* 43 | exit 1 44 | fi 45 | 46 | EXT= 47 | rm -f conftest.cpp 48 | for result in conftest.* 49 | do 50 | EXT="${result##*.}" 51 | done 52 | rm -f conftest.* 53 | 54 | if test "x$EXT" = x 55 | then 56 | echo "failed to detect mex object extension" 57 | exit 1 58 | fi 59 | echo "mex object extension is $EXT" 60 | 61 | for cpp in fncs_*.cpp 62 | do 63 | do_mex=yes 64 | base="${cpp%.*}" 65 | if test -f $base.$EXT 66 | then 67 | if test $base.$EXT -nt $cpp 68 | then 69 | do_mex=no 70 | fi 71 | fi 72 | if test "x$do_mex" = xyes 73 | then 74 | echo "MEX $cpp" 75 | $MEX $CPPFLAGS $LDFLAGS $LIBS $cpp || exit 1 76 | fi 77 | done 78 | 79 | echo "all files up to date" 80 | -------------------------------------------------------------------------------- /matlab/build_mex.bat: -------------------------------------------------------------------------------- 1 | FOR %%i IN (fncs_*.cpp) DO mex %%i -I. -L. -llibfncs -------------------------------------------------------------------------------- /matlab/fncs_die.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | void mexFunction( int nlhs, mxArray *plhs[], 6 | int nrhs, const mxArray *prhs[] ) 7 | { 8 | /* Check for proper number of arguments. */ 9 | if(nrhs!=0) { 10 | mexErrMsgIdAndTxt( "MATLAB:fncs:die:nrhs", 11 | "This function does not have input arguments."); 12 | } 13 | if(nlhs!=0) { 14 | mexErrMsgIdAndTxt( "MATLAB:fncs:die:nlhs", 15 | "This function does not have output arguments."); 16 | } 17 | 18 | /* Call the fncs::die subroutine. */ 19 | fncs::die(); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /matlab/fncs_finalize.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | void mexFunction( int nlhs, mxArray *plhs[], 6 | int nrhs, const mxArray *prhs[] ) 7 | { 8 | /* Check for proper number of arguments. */ 9 | if(nrhs!=0) { 10 | mexErrMsgIdAndTxt( "MATLAB:fncs:finalize:nrhs", 11 | "This function does not have input arguments."); 12 | } 13 | if(nlhs!=0) { 14 | mexErrMsgIdAndTxt( "MATLAB:fncs:finalize:nlhs", 15 | "This function does not have output arguments."); 16 | } 17 | 18 | /* Call the fncs::finalize subroutine. */ 19 | fncs::finalize(); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /matlab/fncs_get_events.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | #include 9 | 10 | void mexFunction( int nlhs, mxArray *plhs[], 11 | int nrhs, const mxArray *prhs[] ) 12 | { 13 | /* Check for proper number of arguments. */ 14 | if(nrhs!=0) { 15 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_events:nrhs", 16 | "This function does not take input arguments."); 17 | } 18 | if(nlhs!=1) { 19 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_events:nlhs", 20 | "This function has one output argument."); 21 | } 22 | 23 | /* Call the fncs::get_events subroutine. */ 24 | vector events = fncs::get_events(); 25 | mwSize size = events.size(); 26 | 27 | /* convert vector to cell matrix */ 28 | mxArray *array = mxCreateCellMatrix(1, size); 29 | if (array == NULL) { 30 | mexErrMsgIdAndTxt("MATLAB:fncs:get_events:mxCreateCellMatrix", 31 | "Unable to create cell matrix."); 32 | } 33 | for (mwIndex i=0; i 4 | 5 | #include 6 | 7 | void mexFunction( int nlhs, mxArray *plhs[], 8 | int nrhs, const mxArray *prhs[] ) 9 | { 10 | /* Check for proper number of arguments. */ 11 | if(nrhs!=0) { 12 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_events_size:nrhs", 13 | "This function does not take input arguments."); 14 | } 15 | if(nlhs!=1) { 16 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_events_size:nlhs", 17 | "This function has one output argument."); 18 | } 19 | 20 | /* Call the fncs::get_events_size subroutine. */ 21 | size_t result = fncs::get_events().size(); 22 | 23 | /* Allocate return value. */ 24 | plhs[0] = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); 25 | 26 | /* Assign return value. */ 27 | uint64_t * data = (uint64_t *) mxGetData(plhs[0]); 28 | data[0] = result; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /matlab/fncs_get_value.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | #include 9 | 10 | void mexFunction( int nlhs, mxArray *plhs[], 11 | int nrhs, const mxArray *prhs[] ) 12 | { 13 | /* Check for proper number of arguments. */ 14 | if(nrhs!=1) { 15 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_value:nrhs", 16 | "This function takes one string."); 17 | } 18 | if(nlhs!=1) { 19 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_value:nlhs", 20 | "This function has one output string."); 21 | } 22 | 23 | /* input must be a string */ 24 | if (!mxIsChar(prhs[0])) { 25 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_value:inputNotString", 26 | "Input 1 must be a string."); 27 | } 28 | 29 | /* copy the string data from prhs into a C string */ 30 | char *key = mxArrayToString(prhs[0]); 31 | if (key == NULL) { 32 | mexErrMsgIdAndTxt("MATLAB:fncs:get_value:conversionFailed", 33 | "Could not convert input to string."); 34 | } 35 | 36 | /* Call the fncs::get_value subroutine. */ 37 | string value = fncs::get_value(key); 38 | 39 | plhs[0] = mxCreateString(value.c_str()); 40 | 41 | /* clean up temporary strings */ 42 | mxFree(key); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /matlab/fncs_get_values.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | #include 9 | 10 | void mexFunction( int nlhs, mxArray *plhs[], 11 | int nrhs, const mxArray *prhs[] ) 12 | { 13 | /* Check for proper number of arguments. */ 14 | if(nrhs!=1) { 15 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_values:nrhs", 16 | "This function takes one string."); 17 | } 18 | if(nlhs!=1) { 19 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_values:nlhs", 20 | "This function has one output argument."); 21 | } 22 | 23 | /* input must be a string */ 24 | if (!mxIsChar(prhs[0])) { 25 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_values:inputNotString", 26 | "Input 1 must be a string."); 27 | } 28 | 29 | /* copy the string data from prhs into a C string */ 30 | char *key = mxArrayToString(prhs[0]); 31 | if (key == NULL) { 32 | mexErrMsgIdAndTxt("MATLAB:fncs:get_values:conversionFailed", 33 | "Could not convert input to string."); 34 | } 35 | 36 | /* Call the fncs::get_values subroutine. */ 37 | vector values = fncs::get_values(key); 38 | mwSize size = values.size(); 39 | 40 | /* convert vector to cell matrix */ 41 | mxArray *array = mxCreateCellMatrix(size, 1); 42 | if (array == NULL) { 43 | mexErrMsgIdAndTxt("MATLAB:fncs:get_values:mxCreateCellMatrix", 44 | "Unable to create cell matrix."); 45 | } 46 | for (mwIndex i=0; i 4 | 5 | #include 6 | 7 | void mexFunction( int nlhs, mxArray *plhs[], 8 | int nrhs, const mxArray *prhs[] ) 9 | { 10 | /* Check for proper number of arguments. */ 11 | if(nrhs!=1) { 12 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_values_size:nrhs", 13 | "This function takes one string."); 14 | } 15 | if(nlhs!=1) { 16 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_values_size:nlhs", 17 | "This function has one output argument."); 18 | } 19 | 20 | /* input must be a string */ 21 | if (!mxIsChar(prhs[0])) { 22 | mexErrMsgIdAndTxt( "MATLAB:fncs:get_values_size:inputNotString", 23 | "Input 1 must be a string."); 24 | } 25 | 26 | /* copy the string data from prhs into a C string */ 27 | char *key = mxArrayToString(prhs[0]); 28 | if (key == NULL) { 29 | mexErrMsgIdAndTxt("MATLAB:fncs:get_values_size:conversionFailed", 30 | "Could not convert input to string."); 31 | } 32 | 33 | /* Call the fncs::get_values subroutine. */ 34 | size_t result = fncs::get_values(key).size(); 35 | 36 | /* Allocate return value. */ 37 | plhs[0] = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); 38 | 39 | /* Assign return value. */ 40 | uint64_t * data = (uint64_t *) mxGetData(plhs[0]); 41 | data[0] = result; 42 | 43 | /* clean up temporary strings */ 44 | mxFree(key); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /matlab/fncs_initialize.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | void mexFunction( int nlhs, mxArray *plhs[], 6 | int nrhs, const mxArray *prhs[] ) 7 | { 8 | /* Check for proper number of arguments. */ 9 | if(nrhs!=0) { 10 | mexErrMsgIdAndTxt( "MATLAB:fncs:initialize:nrhs", 11 | "This function does not have input arguments."); 12 | } 13 | if(nlhs!=0) { 14 | mexErrMsgIdAndTxt( "MATLAB:fncs:initialize:nlhs", 15 | "This function does not have output arguments."); 16 | } 17 | 18 | /* Call the fncs::initialize subroutine. */ 19 | fncs::initialize(); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /matlab/fncs_is_initialized.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | void mexFunction( int nlhs, mxArray *plhs[], 8 | int nrhs, const mxArray *prhs[] ) 9 | { 10 | /* Check for proper number of arguments. */ 11 | if(nrhs!=0) { 12 | mexErrMsgIdAndTxt( "MATLAB:fncs:is_initialized:nrhs", 13 | "This function does not take input arguments."); 14 | } 15 | if(nlhs!=1) { 16 | mexErrMsgIdAndTxt( "MATLAB:fncs:is_initialized:nlhs", 17 | "This function has one output argument."); 18 | } 19 | 20 | /* Call the fncs::is_initialized subroutine. */ 21 | bool result = fncs::is_initialized(); 22 | 23 | /* Allocate return value. */ 24 | plhs[0] = mxCreateNumericMatrix(1, 1, mxLOGICAL_CLASS, mxREAL); 25 | 26 | /* Assign return value. */ 27 | mxLogical * data = (mxLogical *) mxGetData(plhs[0]); 28 | data[0] = result; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /matlab/fncs_publish.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | void mexFunction( int nlhs, mxArray *plhs[], 6 | int nrhs, const mxArray *prhs[] ) 7 | { 8 | /* Check for proper number of arguments. */ 9 | if(nrhs!=2) { 10 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish:nrhs", 11 | "This function takes two strings."); 12 | } 13 | if(nlhs!=0) { 14 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish:nlhs", 15 | "This function does not have output arguments."); 16 | } 17 | 18 | /* inputs must be strings */ 19 | if (!mxIsChar(prhs[0])) { 20 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish:inputNotString", 21 | "Input 1 must be a string."); 22 | } 23 | if (!mxIsChar(prhs[1])) { 24 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish:inputNotString", 25 | "Input 2 must be a string."); 26 | } 27 | 28 | /* copy the string data from prhs into a C string */ 29 | char *key = mxArrayToString(prhs[0]); 30 | if (key == NULL) { 31 | mexErrMsgIdAndTxt("MATLAB:fncs:publish:conversionFailed", 32 | "Could not convert input to string."); 33 | } 34 | 35 | char *val = mxArrayToString(prhs[1]); 36 | if (val == NULL) { 37 | mexErrMsgIdAndTxt("MATLAB:fncs:publish:conversionFailed", 38 | "Could not convert input to string."); 39 | } 40 | 41 | /* Call the fncs::publish subroutine. */ 42 | fncs::publish(key, val); 43 | 44 | /* clean up temporary strings */ 45 | mxFree(key); 46 | mxFree(val); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /matlab/fncs_publish_anon.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | void mexFunction( int nlhs, mxArray *plhs[], 6 | int nrhs, const mxArray *prhs[] ) 7 | { 8 | /* Check for proper number of arguments. */ 9 | if(nrhs!=2) { 10 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish_anon:nrhs", 11 | "This function takes two strings."); 12 | } 13 | if(nlhs!=0) { 14 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish_anon:nlhs", 15 | "This function does not have output arguments."); 16 | } 17 | 18 | /* inputs must be strings */ 19 | if (!mxIsChar(prhs[0])) { 20 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish_anon:inputNotString", 21 | "Input 1 must be a string."); 22 | } 23 | if (!mxIsChar(prhs[1])) { 24 | mexErrMsgIdAndTxt( "MATLAB:fncs:publish_anon:inputNotString", 25 | "Input 2 must be a string."); 26 | } 27 | 28 | /* copy the string data from prhs into a C string */ 29 | char *key = mxArrayToString(prhs[0]); 30 | if (key == NULL) { 31 | mexErrMsgIdAndTxt("MATLAB:fncs:publish_anon:conversionFailed", 32 | "Could not convert input to string."); 33 | } 34 | 35 | char *val = mxArrayToString(prhs[1]); 36 | if (val == NULL) { 37 | mexErrMsgIdAndTxt("MATLAB:fncs:publish_anon:conversionFailed", 38 | "Could not convert input to string."); 39 | } 40 | 41 | /* Call the fncs::publish_anon subroutine. */ 42 | fncs::publish_anon(key, val); 43 | 44 | /* clean up temporary strings */ 45 | mxFree(key); 46 | mxFree(val); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /matlab/fncs_route.cpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | void mexFunction( int nlhs, mxArray *plhs[], 6 | int nrhs, const mxArray *prhs[] ) 7 | { 8 | const int NRHS = 4; 9 | 10 | /* Check for proper number of arguments. */ 11 | if(nrhs!=NRHS) { 12 | mexErrMsgIdAndTxt( "MATLAB:fncs:route:nrhs", 13 | "This function takes %d strings.", NRHS); 14 | } 15 | if(nlhs!=0) { 16 | mexErrMsgIdAndTxt( "MATLAB:fncs:route:nlhs", 17 | "This function does not have output arguments."); 18 | } 19 | 20 | /* inputs must be strings */ 21 | for (int i=0; i 4 | 5 | #include 6 | #include "to_fncs_time.hpp" 7 | 8 | void mexFunction( int nlhs, mxArray *plhs[], 9 | int nrhs, const mxArray *prhs[] ) 10 | { 11 | fncs::time time_requested; 12 | fncs::time time_response; 13 | 14 | /* Check for proper number of arguments. */ 15 | if(nrhs!=1) { 16 | mexErrMsgIdAndTxt( "MATLAB:fncs:time_request:nrhs", 17 | "This function has one input argument."); 18 | } 19 | if(nlhs!=1) { 20 | mexErrMsgIdAndTxt( "MATLAB:fncs:time_request:nlhs", 21 | "This function has one output argument."); 22 | } 23 | 24 | /* Convert input argument. */ 25 | to_fncs_time(time_requested, prhs[0]); 26 | 27 | /* Call the fncs::time_request subroutine. */ 28 | time_response = fncs::time_request(time_requested); 29 | 30 | /* Allocate return value. */ 31 | plhs[0] = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); 32 | 33 | /* Assign return value. */ 34 | uint64_t * data = (uint64_t *) mxGetData(plhs[0]); 35 | data[0] = time_response; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /matlab/to_fncs_time.hpp: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | #include 4 | 5 | static inline void to_fncs_time(fncs::time &value,const mxArray *mat_buf) { 6 | if (!mxIsUint64(mat_buf)) { 7 | mexPrintf("Integer scalar is not uint64, but that's OK.\n"); 8 | } 9 | if (mxGetNumberOfElements(mat_buf) == 1) { 10 | value = mxGetScalar(mat_buf); 11 | } else { 12 | mexErrMsgTxt("Integer scalar is not of size == [1 1].\n"); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /python/fncs.pyx: -------------------------------------------------------------------------------- 1 | # distutils: language = c++ 2 | 3 | from libcpp.string cimport string 4 | from libcpp.vector cimport vector 5 | from libcpp.utility cimport pair 6 | 7 | cimport fncshpp as fncs 8 | 9 | def initialize(const string &configuration=""): 10 | if configuration.empty(): 11 | fncs.initialize() 12 | else: 13 | fncs.initialize(configuration) 14 | 15 | def is_initialized(): 16 | return fncs.is_initialized() 17 | 18 | def time_request(fncs.time next): 19 | return fncs.time_request(next) 20 | 21 | def publish(const string &key, const string &value): 22 | fncs.publish(key, value) 23 | 24 | def route(const string &from_, const string &to, const string &key, const string &value): 25 | fncs.route(from_, to, key, value) 26 | 27 | def die(): 28 | fncs.die() 29 | 30 | def finalize(): 31 | fncs.finalize() 32 | 33 | def update_time_delta(fncs.time delta): 34 | fncs.update_time_delta(delta) 35 | 36 | def get_events(): 37 | return fncs.get_events() 38 | 39 | def get_value(const string &key): 40 | return fncs.get_value(key) 41 | 42 | def get_values(const string &key): 43 | return fncs.get_values(key) 44 | 45 | def get_name(): 46 | return fncs.get_name() 47 | 48 | def get_time_delta(): 49 | return fncs.get_time_delta() 50 | 51 | def get_id(): 52 | return fncs.get_id() 53 | 54 | def get_simulator_count(): 55 | return fncs.get_simulator_count() 56 | 57 | 58 | -------------------------------------------------------------------------------- /python/fncshpp.pxd: -------------------------------------------------------------------------------- 1 | # distutils: language = c++ 2 | 3 | from libcpp.string cimport string 4 | from libcpp.vector cimport vector 5 | from libcpp.utility cimport pair 6 | 7 | cdef extern from "fncs.hpp" namespace "fncs": 8 | 9 | ctypedef unsigned long long time 10 | 11 | void initialize() 12 | 13 | void initialize(const string &configuration) 14 | 15 | bint is_initialized() 16 | 17 | time time_request(time next) 18 | 19 | void publish(const string &key, const string &value) 20 | 21 | void route(const string &from_, const string &to, const string &key, const string &value) 22 | 23 | void die() 24 | 25 | void finalize() 26 | 27 | void update_time_delta(time delta) 28 | 29 | vector[string] get_events() 30 | 31 | string get_value(const string &key) 32 | 33 | vector[string] get_values(const string &key) 34 | 35 | string get_name() 36 | 37 | time get_time_delta() 38 | 39 | int get_id() 40 | 41 | int get_simulator_count() 42 | 43 | -------------------------------------------------------------------------------- /python/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os 3 | 4 | from distutils.core import setup 5 | from distutils.extension import Extension 6 | 7 | # cython is optional -- attempt import 8 | use_cython = False 9 | try: 10 | from Cython.Build import cythonize 11 | from Cython.Distutils import build_ext 12 | use_cython = True 13 | except: 14 | pass 15 | 16 | FNCS_PREFIX = "FNCS_PREFIX" 17 | FNCS_INCLUDE = "FNCS_INCLUDE" 18 | FNCS_LIB = "FNCS_LIB" 19 | 20 | PREFIX = None 21 | INCLUDE = None 22 | LIB = None 23 | 24 | if FNCS_PREFIX in os.environ: 25 | PREFIX = os.environ[FNCS_PREFIX] 26 | INCLUDE = PREFIX + "/include" 27 | LIB = PREFIX + "/lib" 28 | else: 29 | INCLUDE = os.environ.get(FNCS_INCLUDE, "/usr/local/include") 30 | LIB = os.environ.get(FNCS_LIB, "/usr/local/lib") 31 | 32 | sources = ["fncs.cpp"] 33 | if use_cython: 34 | sources = ["fncs.pyx"] 35 | 36 | ext_modules=[ 37 | Extension("fncs", 38 | sources=sources, 39 | libraries=["fncs"], 40 | include_dirs=[INCLUDE], 41 | library_dirs=[LIB] 42 | ) 43 | ] 44 | 45 | if use_cython: 46 | ext_modules = cythonize(ext_modules, language="c++") 47 | 48 | setup( 49 | name = "fncs", 50 | description = "Framework for Network Co-Simulation", 51 | author = "Jeff Daily", 52 | author_email = "jeff.daily@pnnl.gov", 53 | ext_modules = ext_modules 54 | ) 55 | -------------------------------------------------------------------------------- /python/test.py: -------------------------------------------------------------------------------- 1 | import random 2 | import string 3 | 4 | import fncs 5 | 6 | name = "randome_name_" + "".join( [random.choice(string.digits) for i in xrange(8)] ) 7 | 8 | config = """name = %s 9 | time_delta = 1s""" % name 10 | 11 | # generate some time steps 12 | time_steps = sorted(random.sample([i for i in xrange(100)], 10)) 13 | print time_steps 14 | 15 | fncs.initialize(config) 16 | 17 | for time in time_steps: 18 | current_time = fncs.time_request(time) 19 | print "current time is", current_time 20 | fncs.publish("some_key", "some_value") 21 | fncs.finalize() 22 | -------------------------------------------------------------------------------- /src/echo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _ECHO_HPP_ 2 | #define _ECHO_HPP_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #if (defined WIN32 || defined _WIN32) 10 | # if defined LIBFNCS_STATIC 11 | # define FNCS_EXPORT 12 | # elif defined LIBFNCS_EXPORTS 13 | # define FNCS_EXPORT __declspec(dllexport) 14 | # else 15 | # define FNCS_EXPORT __declspec(dllimport) 16 | # endif 17 | #else 18 | # define FNCS_EXPORT 19 | #endif 20 | 21 | namespace fncs { 22 | 23 | class FNCS_EXPORT Echo 24 | { 25 | public: 26 | explicit Echo(); 27 | explicit Echo(const std::string &filename, 28 | std::ios_base::openmode mode=std::ios_base::out); 29 | explicit Echo(const char *filename, 30 | std::ios_base::openmode mode=std::ios_base::out); 31 | ~Echo(); 32 | void open(const std::string &filename, 33 | std::ios_base::openmode mode=std::ios_base::out); 34 | void open(const char *filename, 35 | std::ios_base::openmode mode=std::ios_base::out); 36 | void close(); 37 | void enable_stdout(); 38 | void disable_stdout(); 39 | Echo& operator<< (bool val); 40 | Echo& operator<< (short val); 41 | Echo& operator<< (unsigned short val); 42 | Echo& operator<< (int val); 43 | Echo& operator<< (unsigned int val); 44 | Echo& operator<< (long val); 45 | Echo& operator<< (unsigned long val); 46 | Echo& operator<< (long long val); 47 | Echo& operator<< (unsigned long long val); 48 | Echo& operator<< (float val); 49 | Echo& operator<< (double val); 50 | Echo& operator<< (long double val); 51 | Echo& operator<< (void* val); 52 | Echo& operator<< (std::streambuf* val); 53 | Echo& operator<< (std::ostream& (*pf)(std::ostream&)); 54 | Echo& operator<< (std::ios& (*pf)(std::ios&)); 55 | Echo& operator<< (std::ios_base& (*pf)(std::ios_base&)); 56 | Echo& operator<< (char val); 57 | Echo& operator<< (signed char val); 58 | Echo& operator<< (unsigned char val); 59 | Echo& operator<< (const char* val); 60 | Echo& operator<< (const signed char* val); 61 | Echo& operator<< (const unsigned char* val); 62 | 63 | template 64 | Echo& operator<< (const T &val); 65 | 66 | private: 67 | std::ofstream os; 68 | bool cout_enabled; 69 | }; 70 | 71 | template 72 | Echo& Echo::operator<< (const T &val) { 73 | if (this->os.is_open()) { 74 | this->os << val; 75 | } 76 | if (this->cout_enabled) { 77 | std::cout << val; 78 | } 79 | return *this; 80 | } 81 | 82 | template 83 | Echo& operator<< (Echo& os, const T& val) 84 | { 85 | return os << val; 86 | } 87 | 88 | } 89 | 90 | #endif /* _ECHO_HPP_ */ 91 | 92 | -------------------------------------------------------------------------------- /src/libfncs.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libfncs 7 | Description: Framework for Network Co-Simulation 8 | Version: @VERSION@ 9 | Requires.private: libczmq libzmq 10 | Libs: -L${libdir} -lfncs 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /src/libfncs.vers: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | fncs_*; 4 | _fncs_*; 5 | extern "C++" { 6 | fncs::*; 7 | }; 8 | local: *; 9 | }; 10 | -------------------------------------------------------------------------------- /src/log.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _LOG_HPP_ 2 | #define _LOG_HPP_ 3 | 4 | #include "log.h" 5 | 6 | #if (defined WIN32 || defined _WIN32) 7 | # if defined LIBFNCS_STATIC 8 | # define FNCS_EXPORT 9 | # elif defined LIBFNCS_EXPORTS 10 | # define FNCS_EXPORT __declspec(dllexport) 11 | # else 12 | # define FNCS_EXPORT __declspec(dllimport) 13 | # endif 14 | #else 15 | # define FNCS_EXPORT 16 | #endif 17 | 18 | class Output2Tee 19 | { 20 | public: 21 | static FILE*& Stream1() 22 | { 23 | static FILE* pStream = NULL; 24 | return pStream; 25 | } 26 | 27 | static FILE*& Stream2() 28 | { 29 | static FILE* pStream = NULL; 30 | return pStream; 31 | } 32 | 33 | static void Output(const std::string& msg) 34 | { 35 | FILE* pStream1 = Stream1(); 36 | if (!pStream1) 37 | return; 38 | fprintf(pStream1, "%s", msg.c_str()); 39 | fflush(pStream1); 40 | 41 | FILE* pStream2 = Stream2(); 42 | if (!pStream2) 43 | return; 44 | fprintf(pStream2, "%s", msg.c_str()); 45 | fflush(pStream2); 46 | } 47 | }; 48 | 49 | class FNCS_EXPORT FNCSLog : public Log {}; 50 | 51 | #ifndef FNCS_LOG_MAX_LEVEL 52 | #define FNCS_LOG_MAX_LEVEL logDEBUG4 53 | #endif 54 | 55 | #define FNCS_LOG(level) \ 56 | if (level > FNCS_LOG_MAX_LEVEL) ;\ 57 | else if (level > FNCSLog::ReportingLevel() || !Output2Tee::Stream1()) ; \ 58 | else FNCSLog().Get(level) 59 | 60 | #define LERROR FNCS_LOG(logERROR) 61 | #define LWARNING FNCS_LOG(logWARNING) 62 | #define LINFO FNCS_LOG(logINFO) 63 | #define LDEBUG FNCS_LOG(logDEBUG) 64 | #define LDEBUG1 FNCS_LOG(logDEBUG1) 65 | #define LDEBUG2 FNCS_LOG(logDEBUG2) 66 | #define LDEBUG3 FNCS_LOG(logDEBUG3) 67 | #define LDEBUG4 FNCS_LOG(logDEBUG4) 68 | 69 | #endif /* _LOG_HPP_ */ 70 | -------------------------------------------------------------------------------- /src/tracer.cpp: -------------------------------------------------------------------------------- 1 | /* autoconf header */ 2 | #include "config.h" 3 | 4 | /* C++ standard headers */ 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | /* 3rd party headers */ 16 | #include "czmq.h" 17 | 18 | /* fncs headers */ 19 | #include "fncs.hpp" 20 | #include "fncs_internal.hpp" 21 | 22 | using namespace ::std; 23 | 24 | 25 | int main(int argc, char **argv) 26 | { 27 | string param_time_stop = ""; 28 | string param_file_name = ""; 29 | fncs::time time_granted = 0; 30 | fncs::time time_stop = 0; 31 | vector events; 32 | ofstream fout; 33 | ostream out(cout.rdbuf()); /* share cout's stream buffer */ 34 | 35 | if (argc < 2) { 36 | cerr << "Missing stop time parameter." << endl; 37 | cerr << "Usage: tracer [output file]" << endl; 38 | exit(EXIT_FAILURE); 39 | } 40 | 41 | if (argc > 3) { 42 | cerr << "Too many parameters." << endl; 43 | cerr << "Usage: tracer " << endl; 44 | exit(EXIT_FAILURE); 45 | } 46 | 47 | param_time_stop = argv[1]; 48 | if (argc == 3) { 49 | param_file_name = argv[2]; 50 | fout.open(param_file_name.c_str()); 51 | if (!fout) { 52 | cerr << "Could not open output file '" << param_file_name << "'." << endl; 53 | exit(EXIT_FAILURE); 54 | } 55 | out.rdbuf(fout.rdbuf()); /* redirect out to use file buffer */ 56 | } 57 | 58 | out << "#time\ttopic\tvalue" << endl; 59 | 60 | fncs::initialize(); 61 | 62 | if (!fncs::is_initialized()) { 63 | cout << "did not connect to broker, exiting" << endl; 64 | fout.close(); 65 | return EXIT_FAILURE; 66 | } 67 | 68 | time_stop = fncs::parse_time(param_time_stop); 69 | cout << "stops at " << time_stop << " nanoseconds" << endl; 70 | time_stop = fncs::convert_broker_to_sim_time(time_stop); 71 | cout << "stops at " << time_stop << " in sim time" << endl; 72 | 73 | do { 74 | time_granted = fncs::time_request(time_stop); 75 | cout << "time_granted is " << time_granted << endl; 76 | events = fncs::get_events(); 77 | for (vector::iterator it=events.begin(); it!=events.end(); ++it) { 78 | out << time_granted 79 | << "\t" << *it 80 | << "\t" << fncs::get_value(*it) 81 | << endl; 82 | } 83 | } while (time_granted < time_stop); 84 | cout << "time_granted was " << time_granted << endl; 85 | cout << "time_stop was " << time_stop << endl; 86 | 87 | cout << "done" << endl; 88 | 89 | fout.close(); 90 | 91 | fncs::finalize(); 92 | 93 | return EXIT_SUCCESS; 94 | } 95 | 96 | -------------------------------------------------------------------------------- /tests/config.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "fncs.hpp" 6 | #include "fncs_internal.hpp" 7 | 8 | using namespace std; 9 | 10 | 11 | int main(int argc, char **argv) 12 | { 13 | if (argc != 2) { 14 | cerr << "usage: config filename.[zpl,yaml]" << endl; 15 | return 1; 16 | } 17 | 18 | std::ifstream t(argv[1]); 19 | std::stringstream buffer; 20 | buffer << t.rdbuf(); 21 | 22 | fncs::Config config = fncs::parse_config(buffer.str()); 23 | cout << config.to_string() << endl; 24 | 25 | return 0; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /tests/test.cpp: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "fncs.hpp" 7 | 8 | using std::cout; 9 | using std::endl; 10 | 11 | int main(int argc, char **argv) 12 | { 13 | string value; 14 | vector values; 15 | vector events; 16 | fncs::time granted = 0; 17 | 18 | fncs::initialize(); 19 | 20 | #if 0 21 | /* test default values work */ 22 | value = fncs::get_value("baz"); 23 | values = fncs::get_values("bazl"); 24 | #endif 25 | 26 | /* test sending of messages */ 27 | fncs::publish("key", "value"); 28 | fncs::route("objA", "objB", "key", "value"); 29 | fncs::publish("yet", "again"); 30 | 31 | /* time request */ 32 | granted = fncs::time_request(10); 33 | 34 | /* what messages were received? */ 35 | events = fncs::get_events(); 36 | for (vector::iterator it=events.begin(); it!=events.end(); ++it) { 37 | cout << *it << endl; 38 | } 39 | 40 | #if 0 41 | /* should be updated cache after request */ 42 | value = fncs::get_value("baz"); 43 | values = fncs::get_values("bazl"); 44 | #endif 45 | 46 | fncs::publish("key", "value2"); 47 | 48 | /* time request */ 49 | granted = fncs::time_request(15); 50 | 51 | /* what messages were received? */ 52 | events = fncs::get_events(); 53 | for (vector::iterator it=events.begin(); it!=events.end(); ++it) { 54 | cout << *it << endl; 55 | } 56 | 57 | #if 0 58 | /* cache lists empty now */ 59 | values = fncs::get_values("bazl"); 60 | assert(0 == values.size()); 61 | #endif 62 | 63 | fncs::publish("key2", "value"); 64 | 65 | fncs::finalize(); 66 | 67 | return 0; 68 | } 69 | 70 | -------------------------------------------------------------------------------- /version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This script extracts the FNCS version from src/fncs.hpp, which is the master 4 | # location for this information. 5 | # 6 | if [ ! -f src/fncs.hpp ]; then 7 | echo "version.sh: error: src/fncs.hpp does not exist" 1>&2 8 | exit 1 9 | fi 10 | MAJOR=`egrep '^#define +FNCS_VERSION_MAJOR +[0-9]+$' src/fncs.hpp` 11 | MINOR=`egrep '^#define +FNCS_VERSION_MINOR +[0-9]+$' src/fncs.hpp` 12 | PATCH=`egrep '^#define +FNCS_VERSION_PATCH +[0-9]+$' src/fncs.hpp` 13 | if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then 14 | echo "version.sh: error: could not extract version from src/fncs.hpp" 1>&2 15 | exit 1 16 | fi 17 | MAJOR=`echo $MAJOR | awk '{ print $3 }'` 18 | MINOR=`echo $MINOR | awk '{ print $3 }'` 19 | PATCH=`echo $PATCH | awk '{ print $3 }'` 20 | echo $MAJOR.$MINOR.$PATCH | tr -d '\n' 21 | 22 | --------------------------------------------------------------------------------