Supercharge Your Innovation With Domain-Expert AI Agents!

Decoupling method and device and computer readable storage medium

A decoupling and receiver technology, applied in the computer field, can solve problems such as dependencies and increase engineering complexity, and achieve the effect of decoupling

Inactive Publication Date: 2019-04-05
深圳市技达信息技术有限公司
View PDF0 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 mechanisms and tools other than the c++ programming language in the traditional technology, and increase the complexity of the project, a decoupling method, device and computer can be proposed. read storage medium

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 device and computer readable storage medium
  • Decoupling method and device and computer readable storage medium
  • Decoupling method and device and computer readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

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

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

[0052] 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.

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

[0054] SenderType sender; / / Define the sender

[0055] ReceiverType receiver; / / Define the receiver

[0056] Step S102: The transmitter defines a signal, and the signal includes a slot function type.

[0057] The signal includes a slot function type, a signal name, and a slot list; the first parameter of the slot function type is a variable pointing to the basic type; the slot list is used to store several slots; the slot Including a variable pointing to the basic type and a variable pointing to a slot function;

[0058] One implementation of ...

Embodiment 2

[0160] 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.

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

[0162] 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;

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

[0164] 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

[0193] 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.

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

[0195] 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;

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

[0197] 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, and the signal comprises a slot function type; The receiver defines a slot function according to the slot function type; Connecting a receiver and its slot function to the signal of the transmitter; A transmitter transmits the signal; Wherein a slot function defined by the receiver is called, and a first actual parameter received by the slot function is a variable pointing to the receiver. By utilizing the method disclosed by the invention, decoupling between a transmitter and a receiver can be realized without depending on mechanisms and tools except a c + + programming language.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a decoupling method, device and 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 mechanisms and ...

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 深圳市技达信息技术有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More