Step 1 - What you will need
To get started using the Omni framework, you'll first need a tool chain (compiler, system SDK's, etc.) for the platforms you wish to deploy to and ensure you've setup your build environment properly.
top
Step 2 - Getting the source
You can grab the latest source here and the latest documentation here, you can also visit the source viewer to walk through the code or visit the download page to view other download options.
top
Step 3 - 'Installing' the source
After you've downloaded the latest source, you simply extract the
top
Step 4 - Using the source
Let's start with a very basic thread example, assuming the following code in a file called
Windows1:
Apple/Unix/Linux/POSIX3:
And when run, the output could5 be:
Step 5 - May the source be with you
That's it! After you get your build environment set up, download and reference the source, you're ready to go!
top
But wait, there's more!
Omni is designed to be flexible for the various needs of a developer, as such, you can also build and work with the framework in your favorite IDE; for templates to build Omni as a static library with various IDE's (as well as via command line), you can visit the build help page, where you can download the various solution and project files. And if you need help with a specific class or function, you can visit the class index page where you can browse a hierarchical view of the framework and get help and examples of the individual classes and members of the various namespaces. You can also view the examples page to browse examples of how to use the features of Omni.
If you need to verify your platform is supported or have questions about platform support, you can visit the cross-platform page for more information or visit the system API page which covers the API's called throughout the framework. You can also visit the options page to view compile flags that affect the frameworks operation and helper macros that can be utilized in user code.
top
To get started using the Omni framework, you'll first need a tool chain (compiler, system SDK's, etc.) for the platforms you wish to deploy to and ensure you've setup your build environment properly.
top
Step 2 - Getting the source
You can grab the latest source here and the latest documentation here, you can also visit the source viewer to walk through the code or visit the download page to view other download options.
top
Step 3 - 'Installing' the source
After you've downloaded the latest source, you simply extract the
src.zip file contents to where you want the Omni framework code to reside.
As an example, the build files reference the source at C:\source\omni\
for Windows and /source/omni on other platforms. After you've extracted the source to where you want,
you can start developing with the framework.top
Step 4 - Using the source
Let's start with a very basic thread example, assuming the following code in a file called
main.cpp:/* main.cpp */ #include <iostream> #include <omni/sync/thread> void thread_func() { std::cout << "In thread ... sleeping 5 seconds" << std::endl; omni::sync::sleep(5000); } int main(int argc, char* argv[]) { omni::sync::thread t(&thread_func, omni::sync::thread_option::AUTO_JOIN, true); t.start(); std::cout << "returning from main, thread will automatically join on destruction" << std::endl; return 0; }And then to build the above source (assuming you've extracted the Omni source to
C:\source\omni\ or
/source/omni), you could do the following:Windows1:
cl main.cpp C:\source\omni\library.cpp /IC:\source\omni\ /EHa2 /Feomni.exeApple/Unix/Linux/POSIX3:
g++ main.cpp /source/omni/library.cpp -I/source/omni -pthread4 -o omni.binAnd when run, the output could5 be:
In thread ... sleeping 5 seconds
returning from main, thread will automatically join on destruction
returning from main, thread will automatically join on destruction
1.) Command line build using Visual Studio's Command Line Build tools with the environment set for proper Windows SDK reference.
2.)
3.) Command line build using the GNU GCC compiler; options would be similar with other compilers.
4.) The
5.) In this context could is with regards to the order of the output, since the thread could request to print before or after the main thread.
top2.)
/EHa enables C++ exception handling; if your platform or library doesn't support exception handling, you can define the OMNI_NO_THROW compile flag.3.) Command line build using the GNU GCC compiler; options would be similar with other compilers.
4.) The
-pthread option is needed to link against the target POSIX.1c thread library.
Some compilers will accept either -pthread or -lpthread and some might need -lrt.5.) In this context could is with regards to the order of the output, since the thread could request to print before or after the main thread.
Step 5 - May the source be with you
That's it! After you get your build environment set up, download and reference the source, you're ready to go!
top
But wait, there's more!
Omni is designed to be flexible for the various needs of a developer, as such, you can also build and work with the framework in your favorite IDE; for templates to build Omni as a static library with various IDE's (as well as via command line), you can visit the build help page, where you can download the various solution and project files. And if you need help with a specific class or function, you can visit the class index page where you can browse a hierarchical view of the framework and get help and examples of the individual classes and members of the various namespaces. You can also view the examples page to browse examples of how to use the features of Omni.
If you need to verify your platform is supported or have questions about platform support, you can visit the cross-platform page for more information or visit the system API page which covers the API's called throughout the framework. You can also visit the options page to view compile flags that affect the frameworks operation and helper macros that can be utilized in user code.
top