- format source code (indentation 4 space
This commit is contained in:
@@ -13,57 +13,57 @@ class UserAgent;
|
||||
class WatcherQueue
|
||||
{
|
||||
public:
|
||||
struct Item
|
||||
{
|
||||
enum State
|
||||
struct Item
|
||||
{
|
||||
State_None,
|
||||
State_Active,
|
||||
State_ScheduledToAdd,
|
||||
State_Adding,
|
||||
State_ScheduledToRefresh,
|
||||
State_Refreshing,
|
||||
State_ScheduledToDelete,
|
||||
State_Deleting
|
||||
enum State
|
||||
{
|
||||
State_None,
|
||||
State_Active,
|
||||
State_ScheduledToAdd,
|
||||
State_Adding,
|
||||
State_ScheduledToRefresh,
|
||||
State_Refreshing,
|
||||
State_ScheduledToDelete,
|
||||
State_Deleting
|
||||
};
|
||||
|
||||
resip::ClientSubscriptionHandle mHandle; // Subscription handle
|
||||
ResipSession* mSession;
|
||||
State mState;
|
||||
std::string mTarget; // Target's address
|
||||
std::string mPackage; // Event package
|
||||
void* mTag; // User tag
|
||||
int mId;
|
||||
|
||||
Item()
|
||||
:mSession(NULL), mState(State_None), mTag(NULL), mId(0)
|
||||
{}
|
||||
|
||||
bool scheduled()
|
||||
{
|
||||
return mState == State_ScheduledToAdd || mState == State_ScheduledToDelete || mState == State_ScheduledToRefresh;
|
||||
}
|
||||
};
|
||||
WatcherQueue(UserAgent& agent);
|
||||
~WatcherQueue();
|
||||
|
||||
resip::ClientSubscriptionHandle mHandle; // Subscription handle
|
||||
ResipSession* mSession;
|
||||
State mState;
|
||||
std::string mTarget; // Target's address
|
||||
std::string mPackage; // Event package
|
||||
void* mTag; // User tag
|
||||
int mId;
|
||||
int add(std::string peer, std::string package, void* tag);
|
||||
void remove(int id);
|
||||
void refresh(int id);
|
||||
void clear();
|
||||
|
||||
Item()
|
||||
:mSession(NULL), mState(State_None), mTag(NULL), mId(0)
|
||||
{}
|
||||
|
||||
bool scheduled()
|
||||
{
|
||||
return mState == State_ScheduledToAdd || mState == State_ScheduledToDelete || mState == State_ScheduledToRefresh;
|
||||
}
|
||||
};
|
||||
WatcherQueue(UserAgent& agent);
|
||||
~WatcherQueue();
|
||||
|
||||
int add(std::string peer, std::string package, void* tag);
|
||||
void remove(int id);
|
||||
void refresh(int id);
|
||||
void clear();
|
||||
|
||||
void onTerminated(int id, int code);
|
||||
void onEstablished(int id, int code);
|
||||
void onTerminated(int id, int code);
|
||||
void onEstablished(int id, int code);
|
||||
|
||||
protected:
|
||||
typedef std::vector<Item> ItemList;
|
||||
ItemList mItemList;
|
||||
ice::Mutex mGuard;
|
||||
UserAgent& mAgent;
|
||||
int mActiveId;
|
||||
typedef std::vector<Item> ItemList;
|
||||
ItemList mItemList;
|
||||
ice::Mutex mGuard;
|
||||
UserAgent& mAgent;
|
||||
int mActiveId;
|
||||
|
||||
void process();
|
||||
ItemList::iterator findById(int id);
|
||||
void process();
|
||||
ItemList::iterator findById(int id);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user