CN102306155A - Realizing method of dynamic array type based on universal mobile terminal development platform - Google Patents

Realizing method of dynamic array type based on universal mobile terminal development platform Download PDF

Info

Publication number
CN102306155A
CN102306155A CN201110181165A CN201110181165A CN102306155A CN 102306155 A CN102306155 A CN 102306155A CN 201110181165 A CN201110181165 A CN 201110181165A CN 201110181165 A CN201110181165 A CN 201110181165A CN 102306155 A CN102306155 A CN 102306155A
Authority
CN
China
Prior art keywords
vector
container
array type
dynamic array
mobile terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201110181165A
Other languages
Chinese (zh)
Inventor
张田博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Wuju Technology Co Ltd
Original Assignee
Shenzhen Wuju Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Wuju Technology Co Ltd filed Critical Shenzhen Wuju Technology Co Ltd
Priority to CN201110181165A priority Critical patent/CN102306155A/en
Publication of CN102306155A publication Critical patent/CN102306155A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The invention discloses a realizing method of a dynamic array type based on a universal mobile terminal development platform. In the method, a Vector container definition is used for realizing the dynamic array type, wherein a Vector parameter comprises the total capacity of the container, the current capacity of the container and each self-increase increment value of the container. The realizing method can be applied for a universal mobile terminal application development frame; a universal dynamic array type is realized based on c programming language; differences among different development platforms are shielded; and the utilization efficiency of memory space is enhanced.

Description

Dynamic Array type implementation method based on the general mobile terminal development platform
Technical field
The present invention relates to portable terminal, relate in particular to a kind of Dynamic Array type implementation method based on the general mobile terminal development platform.
Background technology
Along with becoming increasingly abundant of portable terminal application product line; The lasting exploitation of various new platforms; Refine and sum up the common segment between each platform and the product; Reduce the duplication of labour; Strive accomplishing that " general " between the various application platforms becomes becomes more and more important, the various application frameworks that are common to each development platform just arise at the historic moment under this overall background.The purpose of design of this application framework is can run at present more popular a few money main flow platforms, comprises MTK, WIN32, spreadtrum, MStar etc., to upper level applications unified DLL (dynamic link library), functional module and application framework is provided.
In the prior art, use the C language usually, though the C language is general, because the imperfection property of mechanism has also been brought some problems to program development process simultaneously as the assembly language that is used for program development in the above-mentioned application framework.For example; For the realization of the foundation in array type storehouse and data type; In the C language, just can't realize dynamic array type; Thereby brought problems for the distribution of memory headroom: for the routine data allocation space excessive; Can cause the waste of memory headroom; And allocation space is too small, then makes routine data can not get the support of memory headroom again, thereby need distribute again or programme.Therefore, how under portable terminal common application Development Framework, to realize the universal dynamic array type, just seem particularly important based on the C language.
Summary of the invention
The purpose of this invention is to provide a kind of Dynamic Array type implementation method based on the general mobile terminal development platform; This method can realize general Dynamic Array type easily in general portable terminal application development framework, improve the service efficiency of memory headroom.
For achieving the above object, the present invention adopts following technical scheme:
A kind of Dynamic Array type implementation method based on the general mobile terminal development platform; It utilizes the definition of Vector container to realize the Dynamic Array type; Wherein, the parameter of said Vector comprises that container total volume, the current capacity of container and container are each from the increment size that increases.
Further, the data pointer type of said Vector is " no type pointer " void.
Further, when needs increase element in said Vector, comprising:
Step 1: judge whether said Vector is full, if then execution in step 2, otherwise, go to step 6;
Step 2: the container total volume of said Vector is increased the each increment size that increases certainly of said container;
Step 3: in said Vector, load new element;
Step 4: the size that element has been loaded in the current capacity increase of the container of said Vector;
Step 5: judge whether element to be added all is loaded among the said Vector, if, then finish, otherwise, go to step 1;
Step 6: element to be added directly is added among the said Vector, finishes then.
Further, when said Vector is deleted element, said Vector is not subtracted appearance.
Universal dynamic array type implementation method based on the common application development platform provided by the invention; Can be applied in the general portable terminal application development framework; Realize general Dynamic Array type based on the C language; Shield the difference between the different development platforms, improved the service efficiency of memory headroom.
Description of drawings
Fig. 1 is the schematic flow sheet in the time need in Vector, increasing element among the present invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
At first the Vector container is carried out brief description.Vector is that present various higher level lanquage all can provide and very important a kind of type of data structure; Its Core Feature is can the sequential storage element; Support the random access of element; This point is similar to array; And the capacity when container is not enough simultaneously, and when having new element to insert container again, Vector can realize automatic increase; The correct additions and deletions of assurance element are looked into and are changed, and this point is similar to chained list again.
Dynamic Array type implementation method based on the general mobile terminal development platform of the present invention; Promptly be to utilize the definition of Vector container to realize the Dynamic Array type; Wherein, the parameter of said Vector comprises that container total volume, the current capacity of container and container are each from the increment size that increases.
Be below among the present invention to the defined declaration of the data structure of Vector:
Figure BDA0000072639620000031
In the present invention promptly, for the Vector data structure definition 3 basic parameters:
Capacity: container total volume, its initial size value are the sizes values according to the initial application of demand, and along with the size of continuous this total volume of increase of container interior element also constantly increases according to certain increasing law;
Size: the current capacity of container is the current sizes values of having deposited element of Vector;
Capacity_inc: container is each from the increment size that increases; When the off-capacity of container, container can carry out automatic dilatation, and the sizes values of each dilatation is the numerical value of the capacity_inc of setting; Thereby the size of this numerical value should set according to the actual requirements, can not too greatly can not be too little.
In addition, among the present invention, the data pointer type that has also defined in the Vector container is " no type pointer " void, represents the data that can hold any kind in the container.
After Vector data structure and parameter type definition were accomplished, when needs increased element in Vector, the amount of capacity of Vector can increase along with the size that increases element automatically, and detailed process comprises as shown in Figure 1:
Step 1: judge whether Vector is full, whether promptly judges Size more than or equal to Capacity, if then execution in step 2, otherwise, go to step 6;
Step 2: the container total volume Capacity of Vector is increased the each increment size capacity_inc that increases certainly of container;
Step 3: in Vector, load new element;
Step 4: current capacity Size increases the size of having loaded element with the container of Vector;
Step 5: judge whether element to be added all is loaded among the Vector, if, then finish, otherwise, go to step 1;
Step 6: element to be added directly is added among the Vector, finishes then.
It should be noted that: in the present invention; The numerical value of independent increment capacity_inc can be regulated according to the actual requirements; The numerical values recited setting that is this parameter is the open user's of giving; This has great importance for practical application: suitable capacity_inc numerical value is set; Can guarantee the utilization factor of system memory space, promptly the numerical value of capacity_inc can not be provided with excessive, in order to avoid each dilatation is too big; Element to be added is relatively too little, has wasted storage space; Simultaneously, on the basis of guaranteeing the storage space utilization factor, it is too small that the numerical value of capacity_inc also can not be provided with, in order to avoid when inserting element, all need carry out the dilatation operation to Verctor continually at every turn.
In addition; In the present invention; The operation that can also delete, search, replace the element in the Vector container; And for the operation of element deletion; The deletion element does not need dynamically Vector to be subtracted appearance in Vector, joins among the Vector again because all might have new element at any time.
To sum up; The present invention is through definition independent increment parameter in array type; When needs insert new element in the container array; According to the size of the independent increment that is provided with progressively container array capacity is carried out dilatation; Till new element can being inserted into container; Thereby in the common application development platform, realized general Dynamic Array type, shielded the difference between the different development platforms, improved the service efficiency of memory headroom based on the C language.
The above is preferred embodiment of the present invention only, is not to be used for limiting practical range of the present invention; If do not break away from the spirit and scope of the present invention, the present invention is made amendment or is equal to replacement, all should be encompassed in the middle of the protection domain of claim of the present invention.

Claims (4)

1. Dynamic Array type implementation method based on the general mobile terminal development platform; It is characterized in that; Utilize the definition of Vector container to realize the Dynamic Array type, wherein, the parameter of said Vector comprises that container total volume, the current capacity of container and container are each from the increment size that increases.
2. method according to claim 1 is characterized in that, the data pointer type of said Vector is " no type pointer " void.
3. method according to claim 1 is characterized in that, when needs increase element in said Vector, comprising:
Step 1: judge whether said Vector is full, if then execution in step 2, otherwise, go to step 6;
Step 2: the container total volume of said Vector is increased the each increment size that increases certainly of said container;
Step 3: in said Vector, load new element;
Step 4: the size that element has been loaded in the current capacity increase of the container of said Vector;
Step 5: judge whether element to be added all is loaded among the said Vector, if, then finish, otherwise, go to step 1;
Step 6: element to be added directly is added among the said Vector, finishes then.
4. method according to claim 1 is characterized in that, when said Vector is deleted element, said Vector is not subtracted appearance.
CN201110181165A 2011-06-30 2011-06-30 Realizing method of dynamic array type based on universal mobile terminal development platform Pending CN102306155A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110181165A CN102306155A (en) 2011-06-30 2011-06-30 Realizing method of dynamic array type based on universal mobile terminal development platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110181165A CN102306155A (en) 2011-06-30 2011-06-30 Realizing method of dynamic array type based on universal mobile terminal development platform

Publications (1)

Publication Number Publication Date
CN102306155A true CN102306155A (en) 2012-01-04

Family

ID=45380018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110181165A Pending CN102306155A (en) 2011-06-30 2011-06-30 Realizing method of dynamic array type based on universal mobile terminal development platform

Country Status (1)

Country Link
CN (1) CN102306155A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279751A (en) * 2011-08-30 2011-12-14 深圳市五巨科技有限公司 Method and device for storing data of universal development platform
CN106294523A (en) * 2015-06-24 2017-01-04 华平智慧信息技术(深圳)有限公司 A kind of list control and method showing big data item based on finite list item

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101251795A (en) * 2007-11-01 2008-08-27 中国地质大学(武汉) Extensive type space network analysis model and algorithm
CN101706835A (en) * 2009-12-10 2010-05-12 浙江大学 Method for designing micro/nano-scale nonstandard product structure

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101251795A (en) * 2007-11-01 2008-08-27 中国地质大学(武汉) Extensive type space network analysis model and algorithm
CN101706835A (en) * 2009-12-10 2010-05-12 浙江大学 Method for designing micro/nano-scale nonstandard product structure

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279751A (en) * 2011-08-30 2011-12-14 深圳市五巨科技有限公司 Method and device for storing data of universal development platform
CN106294523A (en) * 2015-06-24 2017-01-04 华平智慧信息技术(深圳)有限公司 A kind of list control and method showing big data item based on finite list item

Similar Documents

Publication Publication Date Title
CN102707973B (en) Based on the method and system of the application program launching of android system
CN102981906A (en) Application program background process management method and device
CN104573119A (en) Energy-saving-oriented Hadoop distributed file system storage policy in cloud computing
CN101980157A (en) Mobile terminal starting method and mobile terminal
CN105867956A (en) Method and device for showing plugin view element in host application page
CN102014282A (en) Distributed video transcoding scheduling method and system
CN105487909B (en) A method of reducing power equipment firmware upgrade amount
CN103517141A (en) Sectional type data upgrading method based on IP set top box
CN102141926A (en) Application program management method, device and digital television set top box
CN104461706B (en) A kind of method and multiprocessing device that shared global variable is shared
CN103970668A (en) Memory cleaning method and device as well as terminal
CN103955389B (en) System starting method based on PCM
CN101187884A (en) Resource management method and management system
CN110069215A (en) A kind of method and device of the dynamic adjustment storage unit based on block storage
CN102567220A (en) Cache access control method and Cache access control device
CN102306155A (en) Realizing method of dynamic array type based on universal mobile terminal development platform
CN103019819A (en) Dynamic link library uniform scheduling method based on plug-in mechanism
CN108681469B (en) Page caching method, device, equipment and storage medium based on Android system
CN102609477A (en) Method for implementing serial number generator
CN104102498A (en) Mobile terminal and booting method thereof
CN107066281B (en) Method for rapidly loading large data group based on DSS data system
CN102279751A (en) Method and device for storing data of universal development platform
CN109830992B (en) Self-adaptive adjustment energy scheduling control method, device and system
CN102752374B (en) System and method for storing and accessing power utilization efficacy data
CN102131120B (en) Set top box starting method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120104