SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
ILink.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 
10 #include "EventProcessor.h"
11 #include <cassert>
12 
13 class BitStream;
14 class LinkBase : public EventSrc
15 {
16  // initialized to unknown session
17  uint64_t m_session_token=0;
18 public:
19 
20 virtual ~LinkBase() override = default;
21  uint64_t session_token() const { return m_session_token; }
22  void session_token(uint64_t tok) { m_session_token=tok; assert(m_session_token!=0);}
23 
24  // ACE_Task_Base interface
25  int activate(long /*flags*/, int /*n_threads*/, int /*force_active*/, long /*priority*/, int /*grp_id*/,
26  ACE_Task_Base * /*task*/, ACE_hthread_t /*thread_handles*/[], void * /*stack*/ [], size_t /*stack_size*/[],
27  ACE_thread_t /*thread_ids*/[], const char * /*thr_name*/ []) override
28  {
29  // Links cannot be 'activated', only main event queue processing is allowed
30  assert(false);
31  return -1;
32  }
33 
34 };
35 
uint64_t session_token() const
Definition: ILink.h:21
Definition: EventProcessor.h:14
Definition: BitStream.h:34
virtual ~LinkBase() override=default
Definition: ILink.h:14
int activate(long, int, int, long, int, ACE_Task_Base *, ACE_hthread_t [], void *[], size_t [], ACE_thread_t [], const char *[]) override
Definition: ILink.h:25
void session_token(uint64_t tok)
Definition: ILink.h:22