Unlock instant, AI-driven research and patent intelligence for your innovation.

Decoupling method and computer readable storage medium

A decoupling, receiver technology, applied in the computer field, can solve the problems of increasing the complexity of the project, relying on the moc meta-object compiler, etc., to achieve the effect of reducing the complexity

Active Publication Date: 2019-07-05
深圳市技达信息技术有限公司
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Based on this, in order to solve the technical problems that the Qt signal slot needs to rely on the moc meta-object compiler and increase the complexity of the project in the traditional technology, a decoupling method and a computer-readable storage medium are proposed.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Decoupling method and computer readable storage medium
  • Decoupling method and computer readable storage medium
  • Decoupling method and computer readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0070] Such as figure 1 As shown, as follows:

[0071] Step S101: The transmitter and the receiver have or can be converted to a common base type.

[0072] The type of the transmitter is SenderType, and the type of the receiver is ReceiverType. Both SenderType and ReceiverType inherit from the GObject type, so they have a common base type GObject.

[0073] Specific definitions of transmitters and receivers are exemplified as follows:

[0074] SenderType sender; / / Define the sender

[0075] ReceiverType receiver; / / Define the receiver

[0076] The "has or can be converted to underlying type" feature is designed to facilitate storing multiple emitters (or receivers) into the same list. Therefore, in other embodiments, the transmitter has or can be converted to a base type A, and the receiver has or can be converted to a base type B. A and B can be different, as long as multiple transmitters ( or recipients) to the same list.

[0077] Step S102: The transmitter defines a sign...

Embodiment 2

[0181] Embodiment 1 has a known technical defect: when the receiver is destructed, the transmitter does not know that the receiver has been destructed. At this time, when the transmitter sends a signal, it will still call the receiver’s slot function , which often leads to system crashes.

[0182] In order to solve the above-mentioned technical defect of embodiment 1, make following improvement on the basis of embodiment 1:

[0183] Receiver contains a list of signals that store "variables that point to the list of slots for the signal"; during the connection of the signal, the receiver will "point to the slot for the signal variable of the list" to the list of signals;

[0184] During said disconnection, the receiver removes the "variable pointing to said slot list of said signal" from said signal list;

[0185] When the receiver is destructed, it will traverse the signal list, obtain the "variables pointing to the slot list of the signal", and delete all "pointin...

Embodiment 3

[0214] Embodiment 2 has a known technical defect: if the transmitter is destroyed first, and then the receiver is destroyed, since the receiver does not know that the transmitter has been destroyed when it is destroyed, the receiver still tries to point to the slot of the signal from " List" deletes all the slots of "the variable pointing to the base type points to the receiver", and this often causes the system to crash.

[0215] In order to solve the above-mentioned technical defect of embodiment 2, make following improvement on the basis of embodiment 1:

[0216] The receiver includes a list of "transmitter meta information" that includes variables pointing to the sender and variables pointing to the list of slots for the signal;

[0217] The transmitter includes a receiver list, and the receiver list is used to store variables pointing to receivers;

[0218] During the signal connection process, the receiver takes the variable pointing to the transmitter and the...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention belongs to the technical field of computers, and discloses a decoupling method, which is based on a transmitter and a receiver, and comprises the following steps that the transmitter defines a signal, wherein the signal comprises a slot function type; the receiver defines a slot function according to the slot function type; a receiver and its slot function are connected to the signalof the transmitter; a transmitter transmits the signal; a receiver-defined slot function is invoked. By utilizing the method disclosed by the invention, the decoupling between the transmitter and thereceiver can be realized on the premise of not depending on a moc element object compiler; and since the method does not depend on moc, the engineering complexity is reduced.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a decoupling method and a computer-readable storage medium. Background technique [0002] Qt is a very famous C++-based framework in the industry. Qt provides a decoupling mechanism called "signal slot"; but this mechanism needs to rely on Qt's private meta-object compilation mechanism and corresponding tools (meta-object compiler) outside of the c++ programming language. Since the meta-object compiler needs to perform separate and additional processing on the program source files, the introduction of the meta-object compilation mechanism increases the complexity of the project. [0003] To sum up, it is necessary to invent a new method of decoupling, which can overcome the above-mentioned defects of the prior art. Contents of the invention [0004] Based on this, in order to solve the technical problems that the Qt signal slot needs to rely on the moc meta-object c...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/448
CPCG06F9/449
Inventor 张雷
Owner 深圳市技达信息技术有限公司