reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
python_tag.h File Reference
#include <Python.h>
#include <structmember.h>
#include "tag.h"

Go to the source code of this file.

Data Structures

struct  py_tag_t
 

Functions

py_tag_tconvert_C_tag_to_py (tag_t c_tag)
 Convert C tag to py_tag_t
 
PyObject * py_lf_tag (PyObject *self, PyObject *args)
 
PyObject * py_tag_compare (PyObject *self, PyObject *args)
 

Variables

PyTypeObject PyTagType
 

Detailed Description

@autohr Hou Seng Wong (house.nosp@m.ngw@.nosp@m.berke.nosp@m.ley..nosp@m.edu)

LICENSE

Copyright (c) 2022, The University of California at Berkeley.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

DESCRIPTION

Implementation of functions defined in

See also
pythontarget.h

Function Documentation

◆ convert_C_tag_to_py()

py_tag_t * convert_C_tag_to_py ( tag_t c_tag)

Convert C tag to py_tag_t

Parameters
c_tagThe tag in C.
Returns
py_tag_t* The tag in Python.
Parameters
c_tagThe tag in C.
Returns
PyObject* The tag in Python.

◆ py_lf_tag()

PyObject * py_lf_tag ( PyObject * self,
PyObject * args )

Return the current tag object.

◆ py_tag_compare()

PyObject * py_tag_compare ( PyObject * self,
PyObject * args )

Compare two tags. Return -1 if the first is less than the second, 0 if they are equal, and +1 if the first is greater than the second. A tag is greater than another if its time is greater or if its time is equal and its microstep is greater.

Parameters
tag1
tag2
Returns
-1, 0, or 1 depending on the relation.

Variable Documentation

◆ PyTagType

PyTypeObject PyTagType
extern
Initial value:
= {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "LinguaFranca.Tag",
.tp_doc = "Tag object",
.tp_basicsize = sizeof(py_tag_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
.tp_init = (initproc)Tag_init,
.tp_richcompare = (richcmpfunc)Tag_richcompare,
.tp_getset = Tag_getsetters,
.tp_str = Tag_str,
}
PyObject * Tag_str(PyObject *self)
Definition python_tag.c:156
Definition python_tag.h:43

Definition of the PyTagType Object.