├── .travis.yml
├── LICENSE
├── README.md
├── live.cpp
├── live.hpp
└── sample.cc
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 |
3 | compiler:
4 | - clang
5 | - gcc
6 |
7 | install:
8 | - wget --quiet -O - https://raw.githubusercontent.com/r-lyeh/depot/master/travis.pre.sh | bash -x
9 |
10 | script:
11 | - wget --quiet -O - https://raw.githubusercontent.com/r-lyeh/depot/master/travis.build.sh | bash -x
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 r-lyeh (https://github.com/r-lyeh)
2 |
3 | This software is provided 'as-is', without any express or implied
4 | warranty. In no event will the authors be held liable for any damages
5 | arising from the use of this software.
6 |
7 | Permission is granted to anyone to use this software for any purpose,
8 | including commercial applications, and to alter it and redistribute it
9 | freely, subject to the following restrictions:
10 |
11 | 1. The origin of this software must not be misrepresented; you must not
12 | claim that you wrote the original software. If you use this software
13 | in a product, an acknowledgment in the product documentation would be
14 | appreciated but is not required.
15 | 2. Altered source versions must be plainly marked as such, and must not be
16 | misrepresented as being the original software.
17 | 3. This notice may not be removed or altered from any source distribution.
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | live
2 | ====
3 |
4 | - Live is an automatic reloader of constants during runtime, featuring type inference. Written in C++11.
5 | - Live is cross-platform. Builds on Windows/Linux/MacosX. Compiles on g++/clang/msvc.
6 | - Live is self-contained. No third party dependencies.
7 | - Live is tiny. Header only.
8 | - Live is zlib/libpng licensed.
9 |
10 | ### intro
11 | - On debug, `$live(...)` constants are watched, parsed, evaluated, cached, and returned back as needed.
12 | - On release, `$live(...)` constants are just returned back with no modifications.
13 |
14 | ### sample
15 | ```c++
16 | #include
17 | #include
18 | #include "live.hpp"
19 |
20 | int main() {
21 | // feel free to modify following constants during runtime
22 | for(;;) {
23 | int number = $live(-1234);
24 | double real = $live(3.14159);
25 | const char *string = $live("hello world");
26 | std::string string2 = $live("abcdef");
27 | std::cout << number << ',' << real << ',' << string << ',' << string2 << std::endl;
28 | }
29 | }
30 | ```
31 |
32 | ### cons
33 | - Live requires strict ordering of `$live()` elements during runtime.
34 |
--------------------------------------------------------------------------------
/live.cpp:
--------------------------------------------------------------------------------
1 | #include "live.hpp"
2 |
--------------------------------------------------------------------------------
/live.hpp:
--------------------------------------------------------------------------------
1 | // Simple live reloading of variables, featuring type inference. Written in C++11
2 | // - rlyeh, zlib/libpng license (2014)
3 |
4 | #pragma once
5 |
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include