首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到18条相似文献,搜索用时 93 毫秒
1.
C++静态分析中对泛型构件的识别与表示方法   总被引:5,自引:5,他引:0  
蒋彬  刘超 《微计算机信息》2005,(27):123-125
本文从C++静态分析的角度出发,介绍了模板和泛型构件技术、一个C++静态分析器实现中对模板和基本泛型构件的分析和识别方法、以及一种基于UML的泛型构件的表示方法.  相似文献   

2.
基于源代码静态分析的C++0x泛型概念抽取   总被引:1,自引:0,他引:1  
使用泛型概念对领域知识进行抽象是泛型程序设计方法的基础.在新的C++0x标准中泛型概念将成为一个新的语言设施,这将为设计可复用、可扩展的泛型软件提供坚实的基础.为了更好地利用C++0x的新特性,有必要识别C++遗产代码中的泛型概念,并通过重构得到符合C++0x标准的代码.文中提出了一种基于代码静态分析的泛型概念自动识别方法,通过对泛型程序中类型参数的使用分析,从遗产代码中提取有效表达式约束和关联类型约束,进而推导出泛型概念.将该方法应用于C++标准模板库STL,可以识别出STL算法中绝大部分潜在的泛型概念,表明该方法有助于识别遗产代码中的泛型概念.  相似文献   

3.
对C++教学中的泛型概念和使用进行了探讨,首先通过一个Stack类的例子引出泛型的概念,然后分析了泛型的优缺点并具体分析了模板函数和模板类的具体应用。最后对泛型的程序库STL进行了介绍。  相似文献   

4.
左正康  薛锦云 《软件学报》2015,26(6):1340-1355
泛型程序设计可大幅提高程序的可重用性、可靠性和开发效率.泛型约束机制是对泛型参数进行形式描述,并对其合法性进行检测及验证,从而保证泛型程序的可靠性和安全性.分析总结多种主流语言的泛型约束特性,存在难以描述及验证基于动态语义的复杂约束需求问题,与完整实现GP尚有距离;以抽象程序设计语言Apla为宿主语言,提出了基于代数结构及公理语义的泛型约束方法,给出了基本数据类型、自定义抽象数据类型和子程序的3类泛型约束机制,拓展了泛型程序设计约束的应用范围.同时,支持静态语法和动态语义层约束,提高了泛型约束的精确度;借助Isabelle定理证明器,设计了泛型约束匹配检测和验证算法;进一步设计了泛型约束机制在PAR平台的实现方案及其系统原型.实验部分给出了该泛型约束机制描述、检测及验证一系列复杂泛型约束问题的全过程,自动生成的C++模板程序的可靠性和安全性得到显著提高.  相似文献   

5.
你知道吗?Java SDK的最新版本(JDK1.5,代号为Tiger)里面将会出现泛型(Gernerics)。你可能会疑惑:“什么是泛型?”,或者是“为什么我应该注意泛型?”,甚至是“真酷!怎么使用泛型?”本文将介绍泛型编程、泛型如何使用,以及泛型的优势何在,并讨论泛型将如何的影响到你的工作。为了便于理解,这里给泛型下了一个定义,并给出几个例子来说明如何使用泛型。泛型并不是人人都使用过的一个特性。C++里面有一个类似于泛型的概念:模板。尽管。Java泛型的语法是模仿C++模板的语法,但是、Java语法更易于理解。另外,模板和泛型的执行过程并不相同。Java保留了safe类型,而且当支持泛型时,Java并不暴露源代码。也就是,Java说,Java增加了泛型编程的威力,而并没有出现其它应用语言所出现的诸多问题。  相似文献   

6.
泛型是Java SE 1.5的新特性,从表面上看,无论语法还是应用的环境,泛型类型(或者泛型)都类似于C++中的模板,但实际上它们之间有着本质的区别,其本质区别就在于Java泛型的类型擦除,本文重点介绍Java泛型的类型擦除以解决泛型中常见的令人迷惑的和使人头疼的问题。  相似文献   

7.
鲍亮  陈平 《计算机工程》2006,32(16):95-96,9
讨论了C++反射机制的实现问题,介绍了反射机制的概念和分类,比较了向C++添加反射机制的可能性和方式,提出并分析了一种基于宏定义、模板和泛型机制的C++反射机制实现手段——“简单C++反射机制(Simple C++ Reflection SCR)”。  相似文献   

8.
面向对象、泛型程序设计与类型约束检查   总被引:7,自引:0,他引:7  
孙斌 《计算机学报》2004,27(11):1492-1504
该文对面向对象和泛型程序设计(generic programming)的核心思想和方法进行了较为深入的分析.阐明了各自的目标、技术特征及其优缺点所在.介绍了泛型程序设计针对对象技术的不足所引进的重大革新,即通过类型需求抽象来设计通用、高效的数据结构和算法;着重论述了作者在进一步增强泛型程序设计实际运用方面所提出的改进工作.以C 语言的一个泛型编程扩充语言C**为实施例,详细说明了如何通过一种叫做“命名类型约束”的新的机制来比较完整地实现静态类型需求的直接语言支持和编译检查,为当前泛型程序设计模型的首例编程语言实例.  相似文献   

9.
介绍了C++标准为了适应泛型编程的大规模运用,在语言核心方面对泛型编程能力将要作出的改进,概述了C++模板类型系统Concepts的主要功能和语言要素以及标准库支持,并给出一些例子进行说明。最后,简单介绍了现有的Concepts实现。  相似文献   

10.
结合C 探讨了利用模板技术和STL进行泛型编程,可以极大地改变我们的编程方式,使程序代码更具有可重用性和可维护性.  相似文献   

11.
We outline an approach for extending procedural finite-element software components using generic programming. A layer of generic software components consisting of C++ containers and algorithms is used for parallelization of the finite-element solver and for solver coupling in multi-physics applications. The advantages of generic programming in connection with finite-element codes are discussed and compared with those of object-oriented programming. The use of the proposed generic programming techniques is demonstrated in a tutorial fashion through basic illustrative examples as well as code excerpts from a large-scale finite-element program for serial and parallel computing platforms.
Julian C. CummingsEmail:
  相似文献   

12.
STL是采用泛型编程思想设计的C 通用组件库。函数对象在STL中具有重要作用,它可以进一步提高算法的通用性,增强核心组件的功能。本文在简要介绍函数对象的基础上,讨论了它在STL中的应用。  相似文献   

13.
金柳  杨克俭 《微计算机信息》2007,23(27):268-269,170
本文利用面向对象的设计思想,主要讨论了图形类库,针对动漫设计中各种基本图元的数据描述的数据结构进行了定义,也对各种图元的结构层次和基本操作给出了定义。该图形编辑系统是结合通用图元编辑系统和动漫制作技术,设计的一个专为动画编辑来研究的专用图形编辑器。  相似文献   

14.
In C++, multi‐dimensional arrays are often used but the language provides limited native support for them. The language, in its Standard Library, supplies sophisticated interfaces for manipulating sequential data, but relies on its bare‐bones C heritage for arrays. The MultiArray library, a part of the Boost library collection, enhances a C++ programmer's tool set with versatile multi‐dimensional array abstractions. It includes a general array class template and native array adaptors that support idiomatic array operations and interoperate with C++ Standard Library containers and algorithms. The arrays share a common interface, expressed as a generic programming concept, in terms of which generic array algorithms can be implemented. We present the library design, introduce a generic interface for array programming, demonstrate how the arrays integrate with the C++ Standard Library, and discuss the essential aspects of their implementation. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

15.
The Standard Template Library(STL)is a C library that provides a set of well structured generic C components that work together.Based on its well-structured design,STL can be extended by adding new generic algorithms or new generic containers.In this paper,the work on extending STY by adding several efficient container classes for threaded binary search trees is discussed.It is shown that the addition of threads significantly increases the efficiency of some important access operations on the binary tree containers.In general,significant gain in efficiency can be expected in situations where the data structures ar relatively stable,that is,the data structures are looked up often but modified little.  相似文献   

16.
The generic method model assumes that methods abound and method engineering and application engineering is done in diverse areas. Therefore, it is necessary to understand the notion of a method independent of information systems and software engineering. The generic model presented here abstracts out from product and process meta-models to define a system of concepts that can be used in any domain. Additionally, it integrates in it essential features of methods like quality checking, guidance, backtracking, and traceability. The proposed generic model looks upon a method in two parts, the static and the dynamic parts. The former provides the basic structure of a method whereas the latter is the enactment support provided for application development. The static part provides the notion of method blocks and dependencies between them. Method blocks can be enacted. The generic model is a triple <M, D, E> where M is the set of method blocks, D is the set of dependencies between method blocks, and E is the enactment mechanism.  相似文献   

17.
Engineering application domains need database management systems to supply them with a good means of modeling,a high data access efficiency and a language interface with strong functionality.This paper presents a semantic hypergraph model based on relations,in order to express many-to-many relations among objects belonging to different semantic classes in engineering applications.A management mechanism expressed by the model and the basic data of engineering databases are managed in main memory.Especially,different objects are linked by different kinds of semantics defined by users,therefore the table swap,the record swap and some unnecessary examinations ar reduced and the access efficiency of the engineering data is increased.C language interface that includes some generic and special functionality is proposed for closer connection with application programs.  相似文献   

18.
基于遗传算法和遗传模糊聚类的混合聚类算法   总被引:2,自引:1,他引:2  
张强  李淼 《计算机工程与应用》2007,43(3):164-165,197
为了动态确定聚类数目C和该数目下的最优分类,构造出遗传算法和模糊遗传C均值聚类的混合聚类算法(HGA-FGCM),该方法构造了一个既考虑类与类之间的分散程度,又考虑同一类紧凑程度的目标评价函数;运用遗传算法的全局寻优能力,求得最佳聚类数下的最优聚类。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号