# PhasicFlow: src/phasicFlow/eventSubscriber/eventMessage.hpp Source File

eventMessage.hpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __eventMessage_hpp__
#define __eventMessage_hpp__
namespace pFlow
{
class eventMessage
{
public:
enum event : unsigned int
{
DELETE = 1,
INSERT = 2,
REARRANGE = 4,
SIZE_CHANGED = 8,
CAP_CHANGED = 16,
RANGE_CHANGED = 32
};
protected:
unsigned int message_;
public:
eventMessage()
:
message_(0)
{}
eventMessage(unsigned int msg)
:
message_(msg)
{}
inline unsigned int get()const
{
return message_;
}
inline void set(unsigned int msg)
{
message_= msg;
}
inline void add(unsigned int msg)
{
message_ = message_+ msg;
}
inline bool equivalentTo( const event& evt )const
{
return (message_ & evt) == evt;
}
inline bool isNull()const
{
return message_ == 0u;
}
inline bool isDeleted()const
{
return equivalentTo(event::DELETE);
}
inline bool isInsert()const
{
return equivalentTo(event::INSERT);
}
inline bool isRearranged()const
{
return equivalentTo(event::REARRANGE);
}
inline bool isSizeChanged()const
{
return equivalentTo(event::SIZE_CHANGED);
}
inline bool isCapacityChanged()const
{
return equivalentTo(event::CAP_CHANGED);
}
inline bool isRangeChanged()const
{
return equivalentTo(event::RANGE_CHANGED);
}
};
}
#endif // __eventMessage_hpp__
pFlow::eventMessage::isRearranged
bool isRearranged() const
Definition: eventMessage.hpp:92
pFlow::eventMessage::get
unsigned int get() const
Definition: eventMessage.hpp:58
pFlow::eventMessage::INSERT
@ INSERT
Definition: eventMessage.hpp:35
pFlow::eventMessage
Definition: eventMessage.hpp:29
pFlow::eventMessage::REARRANGE
@ REARRANGE
Definition: eventMessage.hpp:36
pFlow::eventMessage::add
void add(unsigned int msg)
Definition: eventMessage.hpp:68
pFlow::eventMessage::SIZE_CHANGED
@ SIZE_CHANGED
Definition: eventMessage.hpp:37
pFlow::eventMessage::DELETE
@ DELETE
Definition: eventMessage.hpp:34
pFlow::eventMessage::equivalentTo
bool equivalentTo(const event &evt) const
Definition: eventMessage.hpp:73
pFlow::eventMessage::isRangeChanged
bool isRangeChanged() const
Definition: eventMessage.hpp:107
pFlow::eventMessage::isInsert
bool isInsert() const
Definition: eventMessage.hpp:87
pFlow
Definition: demComponent.hpp:28
pFlow::eventMessage::eventMessage
eventMessage(unsigned int msg)
Definition: eventMessage.hpp:53
pFlow::eventMessage::message_
unsigned int message_
Definition: eventMessage.hpp:44
pFlow::eventMessage::isNull
bool isNull() const
Definition: eventMessage.hpp:78
pFlow::eventMessage::RANGE_CHANGED
@ RANGE_CHANGED
Definition: eventMessage.hpp:39
pFlow::eventMessage::isCapacityChanged
bool isCapacityChanged() const
Definition: eventMessage.hpp:102
pFlow::eventMessage::event
event
Definition: eventMessage.hpp:32
pFlow::eventMessage::isDeleted
bool isDeleted() const
Definition: eventMessage.hpp:82
pFlow::eventMessage::CAP_CHANGED
@ CAP_CHANGED
Definition: eventMessage.hpp:38
pFlow::eventMessage::set
void set(unsigned int msg)
Definition: eventMessage.hpp:63
pFlow::eventMessage::eventMessage
eventMessage()
Definition: eventMessage.hpp:48
pFlow::eventMessage::isSizeChanged
bool isSizeChanged() const
Definition: eventMessage.hpp:97