Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "BESConstraintFuncs.h"
00034 #include "BESDataNames.h"
00035
00036 string
00037 BESConstraintFuncs::pre_to_post_constraint( const string &name,
00038 const string &pre_constraint )
00039 {
00040 string str = pre_constraint ;
00041 string new_name = name ;
00042 new_name.append( "." ) ;
00043 if( str != "" )
00044 {
00045 str.insert( 0, new_name ) ;
00046 int pos = 0 ;
00047 pos = str.find( ',', pos ) ;
00048 while( pos != -1 )
00049 {
00050 pos++ ;
00051 str.insert( pos, new_name ) ;
00052 pos = str.find( ',', pos ) ;
00053 }
00054 }
00055
00056 return str ;
00057 }
00058
00059 void
00060 BESConstraintFuncs::post_append( BESDataHandlerInterface &dhi )
00061 {
00062 if( dhi.container )
00063 {
00064 string to_append ;
00065 if( dhi.container->get_constraint() != "" )
00066 {
00067 to_append =
00068 pre_to_post_constraint( dhi.container->get_symbolic_name(),
00069 dhi.container->get_constraint() ) ;
00070 }
00071 else
00072 {
00073 to_append = dhi.container->get_symbolic_name() ;
00074 }
00075 string constraint = dhi.data[POST_CONSTRAINT] ;
00076 if( constraint != "" )
00077 constraint += "," ;
00078 constraint.append( to_append ) ;
00079 dhi.data[POST_CONSTRAINT] = constraint ;
00080 }
00081 }
00082