1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #ifndef AFUN_INTER_INLINE_H
- #define AFUN_INTER_INLINE_H
- #include "inter.h"
- namespace aFuncore {
- EnvVarSpace &Environment::getEnvVarSpace() {
- return env_var;
- }
- Environment &Inter::getEnvironment() {
- return env;
- }
- void Inter::pushActivation(Activation *new_activation) {
- stack.push_front(new_activation);
- activation = new_activation;
- }
- Activation *Inter::popActivation() {
- if (activation == nullptr)
- return nullptr;
- Activation *ret = activation;
- stack.pop_front();
- if (stack.empty())
- activation = nullptr;
- else
- activation = stack.front();
- return ret;
- }
- Inter::InterStatus Inter::getStatus() const {
- return status;
- }
- bool Inter::isInterStop() const {
- return (status == inter_exit || status == inter_stop);
- }
- bool Inter::isInterExit() const {
- return (status == inter_exit);
- }
- const std::list<Activation *> &Inter::getStack() const {
- return stack;
- }
- Activation *Inter::getActivation() const {
- return activation;
- }
- EnvVarSpace &Inter::getEnvVarSpace() {
- return env.env_var;
- }
- InterOutMessageStream &Inter::getOutMessageStream() {
- return out;
- }
- InterInMessageStream &Inter::getInMessageStream() {
- return in;
- }
- size_t Environment::operator++(){
- std::unique_lock<std::mutex> mutex{lock};
- return ++reference;
- }
- size_t Environment::operator--(){
- std::unique_lock<std::mutex> mutex{lock};
- return --reference;
- }
- size_t Environment::operator++(int){
- std::unique_lock<std::mutex> mutex{lock};
- return reference++;
- }
- size_t Environment::operator--(int){
- std::unique_lock<std::mutex> mutex{lock};
- return reference--;
- }
- Inter::InterStatus Inter::setInterStop() {
- InterStatus ret = status;
- if (status != inter_exit)
- status = inter_stop;
- return ret;
- }
- Inter::InterStatus Inter::setInterExit() {
- InterStatus ret = status;
- status = inter_exit;
- return ret;
- }
- }
- #endif //AFUN_INTER_INLINE_H
|