Design of a C++ Software Library for Implementing

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

EXPRESSUserGroup:October19951DesignofaC++SoftwareLibraryforImplementingEXPRESS:TheNISTSTEPClassLibraryDavidA.Sauder-sauderd@cme.nist.govK.C.Morris-kc@nist.gov1AbstractTheNISTSTEPClassLibraryisaC++softwaretoolkitdesignedtoprovidesoftware“buildingblocks”fordevelopingSTEPsoftwareapplications.IthasevolvedoverpastyearsalongwithISO10303-23ProductDataRepresentationandExchange:C++ProgrammingLanguageBindingtotheStandardDataAccessInterface(SDAI)Specifi-cation.ExperiencegainedinimplementingSCLhasbeenimportantforprovidingfeed-backintotheC++bindingandSDAI.ThispaperpresentsbasicdatastructuresusedintheSCLtoimplementanEXPRESSdatadictionaryandtoinstantiateinstancesofenti-ties.DesigndecisionswithrespecttoEXPRESSinheritancemechanismswhicharedifficulttoimplementinC++arediscussed.TheseincludemultipleinheritanceandcomplexinheritanceviaANDandANDORconstructsinEXPRESS.DesigndecisionsarediscussedthatallowsupportofanearlybindingtoanEXPRESSschemaalongwithlatebindingstyledataaccess.Finally,implementationissuesthathavebeenovercomerelatedtoimplementingEXPRESSaggregatesusingC++templatesarediscussed.2IntroductionTheNISTSTEPClassLibrary(SCL)isasetofC++classlibrariesdesignedtobeusedasastartingpointforbuildingapplicationsbasedonanEXPRESS[ISO10303-11]dataspecification1.ThesoftwareprovidesadictionaryofEXPRESSschemainformationandfunctionalityforrepresentingandmanipulatinginstancesofEXPRESSobjects.SCLwasdevelopedwithseveralpurposesinmind.MostnotablyithasbeenusefulforvalidatingemergingconceptsforSTEPimplementationmethodsandfordevelopingsoftwareforSTEP-basedapplications.DevelopersofSCLhaveiteratedthroughthefollowingactivities:STEPstandardsdevelopment,developmentofSCLbasedonSTEPstandards,andfeedbackintothestandardasaresultofimplementationexperience.ParticularattentionhasbeendevotedtoimplementingSTEPPart21:ImplementationMethods-ClearTextEncoding[ISO10303-21],andParts22[ISO10303-22]and231.ThisdocumentassumesabasicknowledgeofEXPRESSandC++[Stroustrup90].EXPRESSUserGroup:October1995DesignofaSoftwareLibraryforImplementingEXPRESS:TheNISTSTEPClassLibrary2[ISO10303-23]theStandardDataAccessInterface(SDAI)andassociatedC++languagebinding.OtherpurposesofSCLincludeto:■helpindustryadoptSTEP,■helpapplicationsandtoolsconformtoSTEP,and■stimulatecommercialdevelopmentofSTEP.ThispaperdiscussessomeofthemoreadvancedfeaturesofSCLandhighlightsdesignchoicesmadeandimplementationchallengesfaced.Thetopicsdiscussedare:■thesoftwareenvironmentincludingsoftwarelibrariesandcomponents(section3)■thelate-bounddatadictionaryimplementation(section4),■genericconstructsusedtoinstantiateentitiesandattributes(section5),■schema-specificconstructsusedtoinstantiateentities(section5),■entityinstantiationimplementationsaccordingtoEXPRESSinheritanceused(ONEOF/OR,AND,andmultiple)(section5),and■challengesintheimplementationofaggregatesusingC++template(section6).FormoreinformationontheSCLarchitectureandtheoveralldesignofthelibrariesthereaderisreferredtothefollowingpublications:■ArchitecturefortheValidationTestingSystemSoftware[Morris92]■ValidationTestingSystem:ReusableSoftwareComponentDesign[Morris92b]■DataProbe:AToolforEXPRESS-BasedData[Morris93]■DataProbeUser’sGuide[Sauder93]3OverviewoftheSCLSoftwareEnvironmentSCLconsistsofschema-independentsoftwareandsoftwarethatisgeneratedforaparticularschema.Theschema-independentsoftwarecomponents:■generateschema-dependentsoftwarecomponents,■provideC++baseclassesforschema-dependentgeneratedclassestoinheritfrom,and■providegenericdatastructurestobeinitializedatrun-timeforaparticularschema.Figure1showsthefourcomponentsusedtogenerateschema-specificcodeforSCL.Thesecomponentsare:■afilecontaininganEXPRESSspecification,■theEXPRESStoC++translator(a.k.a.fedex_plus),■theNISTEXPRESSToolkit[Libes93a],and■theEXPRESSPrettyPrinterToolkit[Libes93b].Fedex_plusgeneratesaC++classlibraryrepresentationofanEXPRESSschemawiththehelpoftheothertwotoolkitsshown.Fedex_plususestheNISTEXPRESSToolkittoparsetheEXPRESSschema,validatetheEXPRESSsyntax,performlimitedsemanticchecking,andbuildanin-memorydictionaryoftheEXPRESSschema.UsingtheEXPRESSToolkitschemadictionaryandformattingroutinesfromtheEXPRESSOverviewoftheSCLSoftwareEnvironmentEXPRESSUserGroup:October19953PrettyPrintingToolkit,fedex_plusthengeneratesaC++coderepresentationoftheschemacalledtheSchemalibrary.TheSchemalibrarygeneratedfromfedex_plususesschema-independentconstructsfromtheSTEPCorelibrary.TheSTEPCorelibraryispartoftheSTEPClassLibrariescomponentshowninfigure1.TheSchemalibrarycontainsroutinesforinitializinganEXPRESS-schema-specificdictionaryatrun-timeusingconstructsfromtheSTEPCorelibrary.Italsocontainstheschema-specificclassesusedtoinstantiateEXPRESSenti-tiesandtypes.Usinginheritancethesegeneratedentityandtypeclasses2extendconstructsdefinedintheSTEPCorelibrarytobeEXPRESS-schema-specific.FIGURE1OverviewofComponentsintheSCLSoftwareEnvironmentSCLimplementsanearlybinding[ISO10303-22section4.7]toanEXPRESSschemawithearlyandlateboundaccesstoinstantiationsofEXPRESSentitiesandtypes.An2.Thetermsentityclassandtypeclasswillbeusedtorefertoaclassgeneratedtore

1 / 20
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功