home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
cpp_config.tcl
< prev
next >
Wrap
Text File
|
1997-01-03
|
6KB
|
214 lines
#---------------------------------------------------------------------------
#
# Copyright (c) 1993 by Westmount Technology B.V., Delft, The Netherlands.
#
# This software is furnished under a license and may be used only in
# accordance with the terms of such license and with the inclusion of
# the above copyright notice. This software or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the software is hereby transferred.
#
# The information in this software is subject to change without notice
# and should not be construed as a commitment by Westmount Technology B.V.
#
#---------------------------------------------------------------------------
#
# File : @(#)cpp_config.tcl /main/hindenburg/3
# Author : frmo
# Original date : 23-2-1993
# Description : Configuration variables / functions
# for CC 3.0 and RogueWave class library
#
#---------------------------------------------------------------------------
#
#
# Configuration variables
#
# has_templates: true if compiler supports templates
#
global has_templates
set has_templates 1
# directory search path for external sources
# could be a list separated by ':'
global exsrc_searchpath
# example usage:
# set exsrc_searchpath /usr/source:/usr/you/project/src
global string::name
set string::name RWCString
global funcmap::key_type_name
set funcmap::key_type_name ${string::name}
#
# PtrSet configuration
#
global set::name
set set::name WmtRWTPtrSet
global set::add
set set::add doInsert
global set::remove
set set::remove doRemove
proc set::iter {sect name type action} {
set s_name [uncap [set_name $name]]
expand_text $sect {
WmtRWTPtrSetIterator<~$type> ~${s_name}It(~$s_name);
while (++~${s_name}It) {
~[eval $action ${s_name}It.key()]
}
}
}
#
# OPtrSet configuration
#
global oset::name
set oset::name WmtRWTOPtrSet
global oset::add
set oset::add append
global oset::remove
set oset::remove remove
proc oset::iter {sect name type action} {
set os_name [uncap [oset_name $name]]
set cnt_name "[uncap [oset_name $name]]_cnt"
expand_text $sect {
int ~$cnt_name;
for (~$cnt_name = 0; ~$cnt_name < ~$os_name.entries(); ~$cnt_name++) {
~[eval $action $os_name\\\[$cnt_name\\\]]
}
}
}
# -------------------------------------------------------------------
# PtrDict configuration
# -------------------------------------------------------------------
global dict::name
set dict::name WmtRWTPtrDict
global dict::set
set dict::set doInsertKeyAndValue
global dict::remove
set dict::remove doRemove
proc dict::get_and_return {sect name key return_type} {
set ptr_name [uncap [pointer_name $return_type]]
expand_text $sect {
~$return_type *~$ptr_name;
~$name.doFindValue(~$key, ~$ptr_name);
return ~$ptr_name;
}
}
proc dict::get_test_and_act {sect name key return_type action} {
set dct_name [uncap [dict_name $name]]
set ptr_name [uncap [pointer_name $return_type]]
expand_text $sect {
~$return_type *~$ptr_name;
if (~$name.doFindValue(~$key, ~$ptr_name)) {
~[eval $action $ptr_name]
}
}
}
proc dict::iter {sect name type qual_type action} {
set dct_name [uncap [dict_name $name]]
set it_name [uncap $name]It
expand_text $sect {
WmtRWTPtrDictIterator<~$qual_type, ~$type> ~${it_name}(~$dct_name);
while (++~$it_name) {
~[eval $action $it_name.value()]
}
}
}
proc dict::initializer {name key value} {
return "${name}(hashIt)"
}
# -------------------------------------------------------------------
# PSetDict configuration
# -------------------------------------------------------------------
global psdict::name
set psdict::name WmtRWTPSetDict
global psdict::add
set psdict::add doInsertKeyAndValue
global psdict::remove
set psdict::remove doRemoveKeyAndValue
proc psdict::get_and_return {sect name key return_type} {
set sdct_name [uncap [set_dict_name $name]]
set set_var [uncap [set_name $sdct_name]]
expand_text $sect {
~$return_type *~$set_var;
~$sdct_name.doFindValue(~$key, ~$set_var);
return ~$set_var;
}
}
proc psdict::iter {sect name type qual_type action} {
set sdct_name [uncap [set_dict_name $name]]
set piv [uncap [set_name $name]]
set psiv [uncap $name]It
set sp [uncap [pointer_name $piv]]
set typeName [$type getName]
expand_text $sect {
WmtRWTPSetDictIterator<~$qual_type, ~$typeName> ~${psiv}(~$sdct_name);
while (++~$psiv) {
WmtRWTPtrSet<~$typeName> *~$sp = ~$psiv.value();
WmtRWTPtrSetIterator<~$typeName> ~${piv}It(*~$sp);
while(++~${piv}It) {
~[eval $action ${piv}It.key()]
}
}
}
}
proc psdict::initializer {name key value} {
return "${name}(hashIt)"
}
# -------------------------------------------------------------------
# OPSetDict configuration
# -------------------------------------------------------------------
global opsdict::name
set opsdict::name WmtRWTOPSetDict
global opsdict::add
set opsdict::add doInsertKeyAndValue
global opsdict::remove
set opsdict::remove doRemoveKeyAndValue
proc opsdict::get_and_return {sect name key return_type} {
set osdct_name [uncap [oset_dict_name $name]]
set oset_var [uncap [oset_name $osdct_name]]
expand_text $sect {
~$return_type *~$oset_var;
~$osdct_name.doFindValue(~$key, ~$oset_var);
return ~$oset_var;
}
}
proc opsdict::iter {sect name type qual_type action} {
set osdct_name [uncap [oset_dict_name $name]]
set piv [uncap [oset_name $name]]
set opsiv [uncap $name]It
set osp [uncap [pointer_name $piv]]
set typeName [$type getName]
expand_text $sect {
WmtRWTOPSetDictIterator<~$qual_type, ~$typeName> ~${opsiv}(~$osdct_name);
while (++~$opsiv) {
WmtRWTOPtrSet<~$typeName> *~$osp = ~$opsiv.value();
for (int i = 0; i < ~$osp->entries(); i++) {
~[eval $action $osp->at(i)]
}
}
}
}
proc opsdict::initializer {name key value} {
return "${name}(hashIt)"
}