Main Page | Modules | Files | Functions | Code Elements | Data Structures | Deprecated

tccore/grm.h

Go to the documentation of this file.
00001 /*==============================================================================
00002                 Copyright (c) 2003-2005 UGS Corporation
00003                    Unpublished - All Rights Reserved
00004  ==============================================================================*/
00005 
00012 /*  */
00013 
00014 #ifndef GRM_H
00015 #define GRM_H
00016 
00017 #include <tccore/grm_errors.h>
00018 #include <fclasses/tc_basic.h>
00019 #include <stdarg.h>
00020 #include <tccore/libtccore_exports.h>
00021 
00115 #define GRM_class_name_c               "ImanRelation"
00116 #define GRM_relationtype_name_size_c   32
00117 
00118 typedef struct GRM_relation_s
00119 {
00120     tag_t the_relation;
00121     tag_t primary;
00122     tag_t secondary;
00123     tag_t relation_type;
00124     tag_t user_data;
00125 } GRM_relation_t, *GRM_relation_p_t;
00126 
00127 #ifdef __cplusplus
00128  extern "C"{
00129 #endif
00130 
00143 extern TCCORE_API int GRM_create_relation(
00144     tag_t               primary_object,     
00146     tag_t               secondary_object,   
00147     tag_t               relation_type,      
00148     tag_t               user_data,          
00149     tag_t*              relation            
00150     );
00151 
00156 extern TCCORE_API int GRM_save_relation(
00157     tag_t               relation    
00158     );
00159 
00163 extern TCCORE_API int GRM_delete_relation(
00164     tag_t               relation    
00165     );
00166 
00174 extern TCCORE_API int GRM_find_relation(
00175     tag_t               primary_object,     
00177     tag_t               secondary_object,   
00178     tag_t               relation_type,      
00179     tag_t*              relation            
00180     );
00181 
00188 extern TCCORE_API int GRM_list_relations(
00189     tag_t               primary_object,     
00190     tag_t               secondary_object,   
00191     tag_t               relation_type,      
00192     tag_t               user_data,          
00193     int*                count,              
00194     tag_t**             relation_list       
00195     );
00196 
00200 extern TCCORE_API int GRM_list_secondary_objects(
00201     tag_t               primary_object,     
00202     tag_t               relation_type,      
00203     int*                count,              
00204     GRM_relation_t**    secondary_list      
00207     );
00208 
00216 extern TCCORE_API int GRM_list_secondary_objects_only(
00217     tag_t               primary_object,     
00218     tag_t               relation_type,      
00220     int*                count,              
00221     tag_t**             secondary_objects   
00222     );
00223 
00227 extern TCCORE_API int GRM_list_primary_objects(
00228     tag_t               secondary_object,   
00229     tag_t               relation_type,      
00230     int*                count,              
00231     GRM_relation_t**    primary_list        
00234     );
00235 
00243 extern TCCORE_API int GRM_list_primary_objects_only(
00244     tag_t               secondary_object,   
00245     tag_t               relation_type,      
00247     int*                count,              
00248     tag_t**             primary_objects    
00249     );
00250 
00254 extern TCCORE_API int GRM_list_all_related_objects(
00255     tag_t               match_object,           
00256     int*                count,                  
00257     GRM_relation_t**    related_object_list     
00260     );
00261 
00268 extern TCCORE_API int GRM_list_all_related_objects_only(
00269     tag_t               match_object,       
00270     int*                count,              
00271     tag_t**             related_objects     
00272     );
00273 
00277 extern TCCORE_API int GRM_ask_primary(
00278     tag_t               relation,       
00279     tag_t*              primary_object  
00280     );
00281 
00285 extern TCCORE_API int GRM_ask_secondary(
00286     tag_t               relation,           
00287     tag_t*              secondary_object    
00288     );
00289 
00293 extern TCCORE_API int GRM_ask_relation_type(
00294     tag_t               relation,       
00295     tag_t*              relation_type   
00296     );
00297 
00301 extern TCCORE_API int GRM_ask_user_data(
00302     tag_t               relation,   
00303     tag_t*              user_data   
00304     );
00305 
00318 extern TCCORE_API int GRM_set_user_data(
00319     tag_t               relation,       
00320     tag_t               new_user_data   
00321     );
00322 
00326 extern TCCORE_API int GRM_list_relation_types(
00327     int*                count,              
00328     tag_t**             relation_type_list  
00329     );
00330 
00334 extern TCCORE_API int GRM_find_relation_type(
00335     const char*         relation_type_name,     
00337     tag_t*              relation_type           
00338     );
00339 
00343 extern TCCORE_API int GRM_create_relation_type(
00344     const char*         relation_type_name,     
00345     tag_t*              relation_type           
00346     );
00347 
00351 extern TCCORE_API int GRM_delete_relation_type(
00352     tag_t               relation_type   
00353     );
00354 
00357 #ifdef __cplusplus
00358 }
00359 #endif
00360 
00361 #include <tccore/libtccore_undef.h>
00362 
00363 #endif