LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lcrel.cc
Go to the documentation of this file.
1 
2 #include "CPPFORT/lcrel.h"
3 
4 #include "lcio.h"
5 #include "IMPL/LCRelationImpl.h"
6 #include <iostream>
7 
8 using namespace lcio ;
9 
11  LCRelationImpl* relation = new LCRelationImpl() ;
12  return reinterpret_cast<PTRTYPE>( relation ) ;
13 }
14 
15 PTRTYPE lcrelcreate( PTRTYPE objectfrom, PTRTYPE objectto, float weight ){
16  LCObject* objf = f2c_pointer<LCObject,LCObject>( objectfrom ) ;
17  LCObject* objt = f2c_pointer<LCObject,LCObject>( objectto ) ;
18  LCRelationImpl* relation = new LCRelationImpl( objf, objt, weight ) ;
19  return reinterpret_cast<PTRTYPE>( relation ) ;
20 }
21 
22 int lcreldelete( PTRTYPE relation ){
23  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
24  delete rel ;
25  return LCIO::SUCCESS ;
26 }
27 
28 int lcrelid( PTRTYPE relation ){
29  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
30  return rel->id() ;
31 }
32 
34  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
35  LCObject* object = rel->getFrom() ;
36  return reinterpret_cast<PTRTYPE>( object ) ;
37 }
38 
40  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
41  LCObject* object = rel->getTo() ;
42  return reinterpret_cast<PTRTYPE>( object ) ;
43 }
44 
45 float lcrelgetweight( PTRTYPE relation ){
46  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
47  return rel->getWeight() ;
48 }
49 
50 int lcrelsetfrom(PTRTYPE relation, PTRTYPE object ){
51  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
52  LCObject* obj = f2c_pointer<LCObject,LCObject>( object ) ;
53  rel->setFrom( obj ) ;
54  return LCIO::SUCCESS ;
55 }
56 
57 int lcrelsetto(PTRTYPE relation, PTRTYPE object ){
58  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
59  LCObject* obj = f2c_pointer<LCObject,LCObject>( object ) ;
60  rel->setTo( obj ) ;
61  return LCIO::SUCCESS ;
62 }
63 
64 int lcrelsetweight(PTRTYPE relation, float weight ){
65  LCRelationImpl* rel = reinterpret_cast<LCRelationImpl*>( relation ) ;
66  rel->setWeight( weight ) ;
67  return LCIO::SUCCESS ;
68 }
69 
LCIO_DEPRECATED_CAPI int lcrelsetweight(PTRTYPE relation, float weight)
Definition: lcrel.cc:64
LCIO_DEPRECATED_CAPI int lcreldelete(PTRTYPE relation)
Definition: lcrel.cc:22
LCIO_DEPRECATED_CAPI PTRTYPE lcrelgetfrom(PTRTYPE relation)
Definition: lcrel.cc:33
LCIO_DEPRECATED_CAPI PTRTYPE lcrelcreate0()
Header file for the f77-wrapper functions of the LCRelation class.
Definition: lcrel.cc:10
LCIO_DEPRECATED_CAPI int lcrelid(PTRTYPE relation)
Definition: lcrel.cc:28
long PTRTYPE
Fortran interface - define the length of pointers this has to made machine independent ...
Definition: cpointer.h:12
LCIO_DEPRECATED_CAPI PTRTYPE lcrelgetto(PTRTYPE relation)
Definition: lcrel.cc:39
LCIO_DEPRECATED_CAPI PTRTYPE lcrelcreate(PTRTYPE objectfrom, PTRTYPE objectto, float weight)
Definition: lcrel.cc:15
LCIO_DEPRECATED_CAPI int lcrelsetfrom(PTRTYPE relation, PTRTYPE object)
Definition: lcrel.cc:50
LCIO_DEPRECATED_CAPI float lcrelgetweight(PTRTYPE relation)
Definition: lcrel.cc:45
LCIO_DEPRECATED_CAPI int lcrelsetto(PTRTYPE relation, PTRTYPE object)
Definition: lcrel.cc:57