1b2732e9dSimarom"""0MQ Context class declaration."""
2b2732e9dSimarom
3b2732e9dSimarom#
4b2732e9dSimarom#    Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
5b2732e9dSimarom#
6b2732e9dSimarom#    This file is part of pyzmq.
7b2732e9dSimarom#
8b2732e9dSimarom#    pyzmq is free software; you can redistribute it and/or modify it under
9b2732e9dSimarom#    the terms of the Lesser GNU General Public License as published by
10b2732e9dSimarom#    the Free Software Foundation; either version 3 of the License, or
11b2732e9dSimarom#    (at your option) any later version.
12b2732e9dSimarom#
13b2732e9dSimarom#    pyzmq is distributed in the hope that it will be useful,
14b2732e9dSimarom#    but WITHOUT ANY WARRANTY; without even the implied warranty of
15b2732e9dSimarom#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16b2732e9dSimarom#    Lesser GNU General Public License for more details.
17b2732e9dSimarom#
18b2732e9dSimarom#    You should have received a copy of the Lesser GNU General Public License
19b2732e9dSimarom#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20b2732e9dSimarom#
21b2732e9dSimarom
22b2732e9dSimarom#-----------------------------------------------------------------------------
23b2732e9dSimarom# Code
24b2732e9dSimarom#-----------------------------------------------------------------------------
25b2732e9dSimarom
26b2732e9dSimaromcdef class Context:
27b2732e9dSimarom
28b2732e9dSimarom    cdef object __weakref__     # enable weakref
29b2732e9dSimarom    cdef void *handle           # The C handle for the underlying zmq object.
30b2732e9dSimarom    cdef bint _shadow           # whether the Context is a shadow wrapper of another
31b2732e9dSimarom    cdef void **_sockets        # A C-array containg socket handles
32b2732e9dSimarom    cdef size_t _n_sockets      # the number of sockets
33b2732e9dSimarom    cdef size_t _max_sockets    # the size of the _sockets array
34b2732e9dSimarom    cdef int _pid               # the pid of the process which created me (for fork safety)
35b2732e9dSimarom    
36b2732e9dSimarom    cdef public bint closed   # bool property for a closed context.
37b2732e9dSimarom    cdef inline int _term(self)
38b2732e9dSimarom    # helpers for events on _sockets in Socket.__cinit__()/close()
39b2732e9dSimarom    cdef inline void _add_socket(self, void* handle)
40b2732e9dSimarom    cdef inline void _remove_socket(self, void* handle)
41b2732e9dSimarom
42