Page MenuHomePhorge

Agent.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

Agent.cpp

/*******************************************************************************
*
* File: Agent.cpp
*
* Contents: Implementation of non-template part of the Agent class.
*
* Copyright 2017
*
* Author: David Juhasz (david.juhasz@tuwien.ac.at)
*
******************************************************************************/
#include "rosa/core/Agent.hpp"
namespace rosa {
Agent::~Agent(void) {
LOG_TRACE("Destroying Agent...");
}
Agent::operator bool(void) const noexcept {
// An Agent itself is always valid.
return true;
}
bool Agent::operator==(const AgentHandle &H) const noexcept {
// Return if the Agent wrapped by H is this very object.
return this == &H.A;
}
AgentHandle Agent::self(void) noexcept { return Self; }
void Agent::sendMessage(message_t &&M) noexcept {
system().send(Self, std::move(M));
}
std::string Agent::dump(void) const noexcept {
LOG_TRACE("Dumping Agent (" + FullName + ")");
return "[Agent] " + FullName;
}
MessagingSystem &Agent::system(void) const noexcept {
// NOTE: The System the Unit is created with is a MessagingSystem.
return static_cast<MessagingSystem&>(Unit::system());
}
} // End namespace rosa

File Metadata

Mime Type
text/x-c++
Expires
Sun, May 31, 4:54 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
322785
Default Alt Text
Agent.cpp (1 KB)

Event Timeline