C++ Class Libraries for Interprocess Communication

C++ Class Libraries for Interprocess Communication
C++ Class Libraries for Interprocess Communication

C++ Class Libraries for Interprocess Communication

Introduction

The demand for ef?cient, portable, and easy to program interprocess communication (IPC) mechanisms has increased as more developers attempt to build distributed applications. Common IPC tasks include:

?Connection establishment and termination, addressing and access to services in the network;

?Communication between processes that may reside on different hardware platforms (e.g., Intel or PowerPC) , operating systems, (e.g., UNIX, OS/2, or Win32), and networks (e.g., Ethernet or ATM);

?Flexible access to various IPC mechanisms (e.g., Sockets, Named Pipes, RPC, shared

memory, etc.).

One way to meet these requirements is to use high-level communication toolkits such as Sun RPC [Sun:94], OSF DCE [OSF:95], OMG CORBA [OMB:95], or Microsoft’s Network OLE [Brockschmidt:95]. However, these solutions are often inef?cient, non-portable, complex, or expensive.

A common way to workaround the drawbacks of higher-level communication toolkits is to program applications using lower-level mechanisms such as Sockets and System V TLI. These mechanisms are widely available under a variety of operating systems. Programming at this level provides the bene?t of ?exibility and performance, while shielding developers from the details of network and transport layer protocols such as TCP, UDP, or IPX/SPX. Sockets are particularly appealing since they are available under most Unix derivatives and also on many PC platforms, including the operating systems in the Windows family and OS/2.

Unfortunately, there are still some portability limitations with using Sockets since different implementations are subtly incompatible. Often the header ?les, error codes, and initialization strategies differ across operating systems. For instance, the Socket library must be explicitly initialized on Win32 platforms, whereas it’s implicitly initialized on Unix. Likewise, under Unix, Socket endpoints are represented by integral ?le descriptors, so that read() or write() are legal calls, which is not the case under Win32, where Socket endpoints are represented as pointer handles.

Portability aside, it’s still dif?cult to program conventional IPC mechanisms due to the inherent non-type safety of the low-level C APIs. As mentioned above, Socket descriptors on Unix are implemented as integral types and as void pointers on Win32. Therefore, at compilation time the compiler cannot assist the programmer in checking the correctness of the application code by identifying invalid operations on Socket endpoints. This makes it all too easy to use the wrong operation at the wrong time (e.g., trying to “accept” a connection on a Datagram Socket).

A time honored way [Schmidt:92] of solving these programming problems is to create class libraries that encapsulate low level IPC APIs with C++ wrappers. This approach offers the following advantages:

?Portability and heterogeneity: The inconsistencies between different IPC implementations remain hidden from the developer. Depending on the sophistication of the C++ wrappers, different mechanisms such as System V TLI and Sockets can be integrated to form a consi-stent interface.

?Ease of programming: The high level of abstraction and additional functionality provided by C++ wrappers can make developing network applications easier by hiding low-level

details of the C-level IPC APIs.

?Reuse: Routine tasks and repetitive procedures can be handled by the library. This abstrac-tion makes the application code shorter, more readable, and easier to maintain.

?Type-safety and robustness: C++ wrappers can eliminate entire categories of common

errors. One example is the use of Internet Socket addresses. The C-level sock API requires the developer to initialize the allocated memory - e.g., using the memset() call - after

de?ning a variable of type sockaddr_in. If the programmer forgets to perform this initializa-tion, the program behavior is unpredictable. Unfortunately, these types of errors occur at runtime and are hard to diagnose without tedious debugging sessions. In contrast, a C++ class library can eliminate these common errors. For instance the initialization of the

sockaddr_in structures can be hidden in the constructor of a network address class.

Although C++ wrappers solve many problems for application programmers, it is time consuming to develop these types of class libraries from scratch. Developers of network programming wrappers must have a deep understanding of many topics including networking, object-oriented design, and C++. Therefore, most organizations can’t afford to devote the resources necessary to reinvent, debug, document, and maintain these wrappers internally.

Fortunately, there are now several options available to developers. For instance, two C++ IPC class libraries (Socket++ and the Adaptive Communications Environment (ACE)) can be freely obtained via anonymous ftp or the WWW. There are also several commercially supported C++ IPC class libraries from vendors such as Rogue Wave’s (Net.h++) and ObjectSpace’s (Systems). This article compares the functionality and performance of three of these

C++ IPC class libraries (Socket++, ACE, and Net.h++). Our test environment consisted of Sun SPARCstations running Solaris 2.4, using Sun CC 4.0.1 to compile Net.h++ and ACE, and GNU gcc 2.7.0 to compile Socket++.

Net.h++

In the C++ community, RogueWave has established itself as a world leader in class libraries, all of which end with .h++. The ?agship product of Rogue Wave is Tools.h++. This widely used component library consists of collection classes and reusable data structures and algorithms designed for general-purpose applications. Quite logically, Rogue Wave used this library to implement Net.h++, making the installation of Tools.h++ (version 6.1) a precondition for working with this library.

RogueWave designed Net.h++ to allow independence from several operating systems and networking protocols. The present version 1.0 supports the software platforms Unix (Solaris, SunOS, HP-UX), Windows (Winsocks by Microsoft, NetManage Chameleon, Trumpet and Wollongong), and Windows NT. AIX, SGI, OS/2 and Windows95 have been planned for the future. The library is available in source code form for an additional cost.

System Architecture

The architecture of Net.h++ is subdivided into four layers shown in Figure 1 (the modules not contained in Version 1.0 are marked in grey). The lowest layer of Net.h++ provides the basic services of Tools.h++. The next layer is the Communication Adapters Layer. It contains an encapsulation of Sockets and TCP/IP addresses that provides a thin veneer atop the existing C-APIs. Unfortunately, this short list contains all the communication mechanisms supported by the current version. For future releases, RogueWave plans to include extensions for TLI, (Named) Pipes, RPC, CORBA, and FTP.

One layer up is the Portal Layer. This layer provides a more abstract C++ programming API than the Communication Adapters Layer. The Portal Layer presents a uniform, transport independent view of the different underlying communication mechanisms to applications. In addition, it

provides functionality not found in the underlying layer, such as sending or receiving a speci?c amount of data.

The highest level of abstraction in the Net.h++ architecture is the Communication Services Layer. At this level programmers can treat communication channels as C++ IOStreams. By using the overloaded functions operator<<() and operator>>(), programmers can send complex objects without changing their morphology (i.e., their internal structure). This illustrates the strong integration with Tools.h++, which provides a mechanism known as “Virtual Streams” that send objects in binary, ASCII or XDR encoded formats. As a possible extension to the Communication Services Layer, RogueWave proposes an implementation of the Acceptor pattern [Schmidt:95] that could simplify the development of servers for different purposes.

One of the tutorials, called “The Receptionist,” outlines how such an Acceptor could work. The basic idea is to separate (1) the communication semantics of server applications from (2) the handling of connection requests. While the former cannot be done in a general way (since this depends on the application’s communication protocol), the latter can be generic. Just like an of?ce receptionist handles the phone traf?c without knowing the topics of conversation, the Receptionist classes implement strategies for answering connection requests and dispatching them. The tutorial describes classes that can implement sequential, concurrent, and event driven receptionist strategies.

Installation and Documentation

The installation procedure for Net.h++ is well documented in the Installation Guide. I was able to install it without much dif?culty, though the manual did contain a minor mistake. Instead of using the command "cd C:\rogue", which clearly does not make any sense under Unix, you have to change into the directory above (!) the Tools.h++ home directory. Then the library is written onto the disk using tar and uncompress. Unfortunately, the manual does not indicate that afterwards the tar ?le can be deleted again. The second installation step consists in compiling the source code. The necessary adjustments to Make?le are performed by the script con?g_make - with exemplary convenience. Afterwards, the compilation of the library and the accompanying example programs proceeded smoothly in the test.

The examples chosen are easily understood and provide a good survey of the essential features of Net.h++. For instance, the 'hostinfo' example provides information on an Internet machine, 'greet' sends a message to an Internet address and outputs the answer, 'wwwget' loads a URL-speci?ed HTTP page.

The Net.h++ manual contains about 130 pages (without appendices) covering the user's guide, tutorials and the class reference. The user's guide provides a good survey of the essential concepts and allows the user to become familiar with how to program applications using Net.h++. Users who are not familiar with OOD, however, must learn the OMT style diagrams since the syntax is not fully explained. The tutorial supplements the examples with an extensive sample program that also explains some general dif?culties encountered in interprocess communication.

Sample Program

Listing 1 shows the code for “net?nger,” illustrating a use-case example of Net.h++. The program implements a simpli?ed “?nger” client, which is a standard Internet service that provides information about a user. Unlike the ?nger program found on Unix machines, this version does not directly retrieve any information itself, but gets the whole report from a ?nger daemon. The same example will be used for Socket++ and ACE to show how the various approaches differ.

In line (1), the Winsock DLL is initialized, if the program is compiled under Windows. Although Unix does not require such an initialization, this statement is necessary for portability reasons. For our Solaris Unix tests this call is conditionally compiled to nothing. The object 'info' is generated on the stack as an automatic variable; the destructor of the class RWWinSockInfo performs the necessary cleanup when leaving the main() function.

Under (2) the command line arguments are checked. The program should be called using

net?nger user@host.

Under (3) we see Net.h++’s usage of C++ Exception Handling for errors. The bene?t of this approach is that the application’s handling of errors is kept separate from the usage of the library. This improves the readability of the code and can increase the programs ability to react to errors. For instance C++ Exceptions allow applications to react to exceptions raised in constructors -which will create problems with traditional methods of error treatment.

(4) demonstrates the use of RWInetAddr. This class contains the host IP address, a port number, the Socket type (Stream, Datagram or raw), and the transport protocol to use. As always, our C++ solution is more robust and easier to program than a C solution due to the use of constructors and default parameters . In this example, the port is identi?ed by the service name '?nger', the host name is indicated by the user in the program request, the default protocol is TCP, and the Socket type is SOCK_STREAM.

Specifying the port number and host by strings results in a call to the constructors of RWInetPort and RWInetHost that take string parameters. These classes internally call the C-API functions getservbyname() and gethostbyname() to initialize their private data structures. (This is, however, not done in the class constructors, but when the information is actually needed.)

At (5) the connection is set up. In case of an extension of Net.h++, the variable ?ngerd of the RWPortal type could incorporate also a (?ctitious) RWTLIPortal (another subclass of RWPortal using the communication channel System V TLI) instead of an RWSocketPortal. This change can be made without requiring any code modi?cations. In the line marked (6) the inquiry is addressed to the ?nger server. This inquiry simply consists of the name of the user, on which the information shall be obtained, and is completed with a carriage return and a line feed. The member function RWPortal::sendAtLeast() guarantees that the complete inquiry will be sent, even if this requires several calls of the lower C-API to be made.

The ?nger server’s reply is received in line (7). For illustration purposes, an object from the C++ IOStream category is used. The characters are read individually with get() to prevent the suppression of blanks, tabs and line feeds. The code used is not too inef?cient since the RWPortalIStream, like any IOStream, performs its own buffering. Ostream cout, however, is also buffered, so that we synchronize its output to screen with the ?ush manipulator.

An alternative to using an IOStream is shown at line (8). This time the element function RWPortal::recv() is used. The output is closed as before under (7) after the ?nger server has completed its answer with EOF and closed down the connection.

Overall, the performace of Net.h++ was satisfactory although the current version of the library does not cover many issues related to developing distributed applications (such as event loop integration, naming and location services, etc.). However, the basic tools provided worked smoothly and without error.

Socket++

Unlike Net.h++ the Socket++ library by author Gnanasekaran Swaminathan can be obtained free of charge from the Internet. At the time of our test, the version of Socket++ was 1.10. The basic idea behind Gnanasekaran’s library is to provide access to Socket communication channels using the C++ IOStream interface. Although this approach is similar to Net.h++’s usage of IOStreams, Socket++ is more closely tied to the use of IOStream interfaces. This reduces the learning curve for programmers who are already familiar with IOStreams and Sockets. Another advantage of

Socket++ is the elegant and type-secure access to Sockets through operator<<() and operator>>(), which allow applications to send and receive objects while maintaining morphology.

System Architecture

Figure 2 illustrates the Socket++ class hierarchy. The class sockbuf has been derived from streambuf (which is not part of the illustration since it belongs to the IOStream library) and is used to buffer Socket I/O. The actual reading from and writing to the Socket takes place in this class. The sockunixbuf and sockinetbuf subclasses offer specializations of the Unix or Inet communication domains, respectively. The iosockstream class has been derived from iostream and provides SOCK STREAM semantics. The classes isockstream or osockstream cover the read-only or write-only access. For Sockets and Unix Pipes the respective subclasses are available. The descendants of the abstract class sockAddr provide the encapsulation of network addresses. In addition, there are classes that implement standard Internet protocols like Echo, FTP and SMTP. Fork implements the fork() system request.

Installation and Documentation

Not surprisingly, a free library is rarely as comprehensive as a commercial product. For Socket++ this applies to the number of compilers and operating systems the library has been ported to and tested with. Unfortunately, a port to Windows is not included. Moreover, due to the peculiarities of the available Winsock implementations (e.g., Sockets endpoints are pointer handles rather than integers), major changes would be required to port the available source code to Windows.

The easiest way to compile Socket++ is to use the GNU gcc (version 2.4.0 and higher), which is available on a variety of operating systems. Though I did not attempt to use the Sun CC 4.0.1, with a little effort, this compiler could also be used.

Socket++ is not a "library for the poor". Quite on the contrary, it offers a surprisingly rich number of features. This can already be seen at the installation, which uses the autoconf GNU mechanism and consequently, could hardly be easier. Even an automatic selftest is performed. The utility classes for the Echo, FTP and SMTP protocols have already been mentioned. Thus, for example, it is possible to implement an Echo server with less than ten lines of code. Although this is not very practical (since the Echo server is already a standard Internet service), it serves as a good example for your own implementations.

The manual is available in Postscript format and contains about 50 pages. Unfortunately it belongs to version 1.6 and is thus not quite up to date. You will need some time to get used to the

combined reference section/user's guide that is interspersed with many examples. Supports of the GNU project will be pleased to hear that the manual is available in Texinfo format, too.

Sample Program

Listing 2 demonstrates the net?nger example applied to Socket++. Part (1) shows the treatment of the call arguments (the same as for Listing 1). In (2) a Socket from the Internet domain with IOStream encapsulation is provided for reading and writing (class iosockinet). Evidently, in contrast to Net.h++, error treatment is performed internally in the library and not with Exception Handling procedures. However, this is quite suf?cient for our simple example. Anyone who nevertheless insists on Exception Handling should use the older version 1.8 containing this mechanism - it has been dropped afterwards because several compilers do not yet support it. Rather than omitting this feature altogether, a better alternative would have been to use different mechanisms via conditional compilation.

The connection is set up with a connect() call (4) that implicitly uses a sockinetaddr. The port to be addressed is identi?ed by the service description '?nger'. (5) illustrates the use of operator<<() to send an inquiry to the server. Under (6) the answer is read out (as in Listing 1).

The assessment regarding runtime behavior and stability given for Net.h++ also applies to Socket++. I didn’t ?nd any serious problems.

ACE (ADAPTIVE Communication Environment)

As with Socket++, ACE can be freely obtained via anonymous FTP or the WWW. Douglas C. Schmidt from Washington University is the author of most parts of ACE. ACE was originally designed as a framework to simplify Doug’s research on design patterns and performance bottlenecks in parallel communication software. Over time, the library has matured and is now used in many commercial projects at companies like Bellcore, Ericsson, Motorola, Kodak and Siemens.

Like the two other libraries, ACE is designed as a toolkit for object-oriented network programming. The primary difference between ACE and the other libraries I evaluated is its scope, which goes far beyond that of Socket++ and Net.h++. This scope becomes evident when downloading the program from the FTP server. The overall release occupies around 1.4 megabytes of source code, tests, and example applications (not including the documentation, which is available separately). After compilation, the entire release occupies over 90 megabytes,

due largely to the aggressive use of C++ templates and method inlining in ACE (most of the inlining can be conditionally compiled out).

System Architecture

Figure 3 outlines the ACE system architecture. The encapsulation of Unix and Winsock Sockets is called SOCK_SAP. A common interface with the System V TLI encapsulation (TLI_SAP) enables programs to be written independently of the communication channel used. Furthermore ACE contains C++ wrappers for many other Unix IPC mechanisms including System V Unix STREAM Pipes and Named Pipes, Threads, memory-mapped ?les, and System V IPC mechanisms such as Shared Memory, Semaphore and Message Queues.

The encapsulation of IPC mechanisms represents only one of ACE's many features. As shown in Figure 3, ACE also includes C++ components for event demultiplexing (Reactor), dynamic linking and service con?guration (Service Con?gurator), multi-threading and concurrency control (Synch wrappers and Thread Manager), shared memory management (Shared Malloc), connection management (Connector and Acceptor), CORBA integration (CORBA Handler), layered service management (ASX), and distributed services like naming, locking, logging, and routing (which are not shown in the ?gure). Although it is beyond the scope of this article to cover these components you can ?nd out more about them by examining the technical papers and documentation distributed with ACE.

Installation and Documentation

Although ACE is farther away from being a ?nished product than Socket++ and Net.h++, its installation runs smoothly if you use one of the compilers supported. For the ACE 3.3 version tested in our study these include Sun C++ 3.x and 4.x under SunOS 4.1.x and Solaris 2.x. More recent versions of ACE have now been ported to other OS platforms such as SCO Unix, HP-UX, SGI, OSF/1, AIX, Linux, Windows 95 and Windows NT.

Documentation is the biggest problem with ACE. The documention available consists mainly of articles in Postscript format that have been prepared by the author for technical journals and conferences. Each paper addresses certain aspects of ACE, but there is no comprehensive programmers guide. Although, ACE provides manual pages in nroff and HTML formats that are generated from the classes' header ?les, reading this material is insuf?cient to familiarise yourself with the complex relations between the different frameworks and components in ACE. Users have to dive into the source code and examples to ?gure it all out. This can be hard since the interaction between the ACE framework and application code uses callbacks and other forms of

decoupled component integration. Application developers will need to have a good understanding of the structure and behavior of the framework tp use it effectively. The payoff can be considerable, but so is the effort required to understand the entire framework. Fortunately, ACE is designed in modular fashion, so it’s possible to use subsets of its functionality quite easily without getting mired in the swamp of complexity.

Sample Program

Listing 3 shows the implementation of our net?nger example under ACE. From the multitude of functions available only the SOCK_SAP component will be used, which more or less corresponds to Net.h++ and Socket++, although it doesn’t provide the higher-level C++ IOStream integration available with the other libraries.

Part (1) stays the same, under (2) a Socket object of the SOCK_STREAM type is generated. This example shows that ACE provides individual subclasses for each type of Socket, whereas Net.h++ and Socket++ provide a member variable that represents the Socket type. ACE's approach offers more type security, but potentially leads to code that is harder to change. (3) also illustrates that ACE spreads its functionality among more classes than the other two libraries. For instance, the ACE_SOCK_Stream class does not set up the connection itself but uses the service of the ACE_SOCK_Connector class. (4) shows ACE error treatment by way of checking return values and by using preprocessor macros. In (5) and (6) the lack of the familiar IOStream interface under ACE becomes apparent. The function send_n(), however, guarantees that the desired number of bytes will be sent. Finally in (7) the explicit closing of the Socket connection is shown.

Assessing the runtime ef?ciency of ACE is as dif?cult as with the other two C++ IPC libraries we’ve reviewed. However, ACE provides some potential performance advantages due to its extensive use of inlining and templates. A disadvantage of these optimizations, of course, is that the size of the object code can be quite large, depending on how the compiler implements templates and how ACE is conditionally compiled.

Assessment

Any application developer who is primarily interested in a stable Socket encapsulation in conjunction with a comfortable interface and professional support will appreciate Net.h++. I hope that RogueWave increases the number of communications channels supported and also offers frameworks for programming clients and servers at a higher abstraction level.

Socket++ may be an alternative solution, if you are willing to accept the limitations of a noncommercial product. Moreover, many developers have found that programmers of free software react very cooperatively to the "customer's requests."

Managing ACE requires the willingness on the part of developers to deal intensively with the program package. However, it offers quite a lot of functionality and has an active user community to provide support. Therefore, ACE is the right choice if you’re looking for more than just interprocess communication support and if you can afford the effort needed to familiarise yourself with the framework.

References

[Brockschmidt:95] Kraig Brockschmidt, “Inside OLE, 2nd Edition“, Microsoft Press, 1995. [OMG:95] “The Common Object Request Broker Architecture and Speci?cation,” version 2, Object Management Group, July 1995

[OSF:95] OSF (Ed.), “Introduction to OSF DCE“, Prentice Hall, 1995.

[Schmidt:92] Douglas C. Schmidt, “IPC_SAP: An Object-Oriented Interface to Interprocess Communication Services,” C++ Report, V olume 4, Number 9, 1992.

[Schmidt:95] Douglas C. Schmidt, “Design Patterns for Establishing Network Connections,” C++ Report, V olumn 7, Number 9, 1995

[Sun:94] “Network Interface Programmer‘s Guide“, Sun Microsystems Inc., 1994.

About the authors

Prof. Dr.-Ing. habil. Wilhelm Dangelmaier is Professor for Computer Integrated Manufacturing at the Heinz Nixdorf Institute of Paderborn University, Germany. His research interests include modeling of distributed manufacturing systems and tools to plan, schedule, monitor, and control these systems.

Dipl. Ing. S?ren Henkel (soeren@hni.uni-paderborn.de) is a PhD student and scienti?c employee at the Heinz Nixdorf Institute of Paderborn University, Germany. His research focuses on a program system for model-based distributed production control.

Listings

Listing 1:net?nger with Net.h++

// net?nger: request to a ?nger daemon

#include

#include

#include …rw/net/inetaddr.h“ // Internet addresses

#include …rw/net/sockport.h“ // sockets

#include …rw/net/portstrm.h“ // socket IOStreams

#include …rw/net/winsock.h“ // for portability

#include …rw/net/neterr.h“ // exception handling

void usage(char* prog)

{

cerr << …Usage: … << prog << … [user]@[host]“ << endl;

exit(1);

}

main(int argc, char **argv)

{

// (1) for portability: initialize Winsock DLL

RWWinSockInfo info;

// (2) simple argument parsing

if (argc!=2)

usage(argv[0]);

char* user=argv[1];

char* host=strrchr(user,‘@‘);

if (!host)

usage(argv[0]);

*host++=‘\0‘;

// (3) exception handling

try

{

// (4) addressing

RWInetAddr addr(…?nger“, host);

// (5) connection establishment

RWPortal ?ngerd=RWSocketPortal(addr);

// (6) request

?ngerd.sendAtLeast( RWCString(user)+“\r\n“ );

// (7) answer

RWPortalIStream answer(?ngerd);

char c;

while(answer.get(c))

cout << c;

cout << ?ush;

//(8) alternative:

//RWCString packet;

//while ( !(packet=?ngerd.recv()).isNull() )

//cout << packet;

}

catch (const RWxmsg& x)

{

cerr << …Error: … << x.why() << endl;

}

return 0;

}

Listing 2:net?nger with Socket++

// net?nger: request to a ?nger daemon

#include

#include

#include …sockinet.h“// socket stream in Internet domain

void usage(char* prog)

{

cerr << …Usage: … << prog << … [user]@[host]“ << endl;

exit(1);

}

main(int argc, char **argv)

{

// (1) simple argument parsing

if (argc!=2)

usage(argv[0]);

char* user=argv[1];

char* host=strrchr(user,‘@‘);

if (!host)

usage(argv[0]);

*host++=‘\0‘;

// (2) iosockinet encapsulates a socket with IOStream semantics // (3) error handling: internally

iosockinet ?ngerd(sockbuf::sock_stream);

// (4) connection establishment

?ngerd->connect(host,“?nger“);

// (5) request

?ngerd << user << …\r\n“ << ?ush;

// (6) answer

char c;

while(?ngerd.get(c))

cout << c;

cout << ?ush;

return 0;

}

Listing 3:net?nger with ACE

// net?nger: request to a ?nger daemon

#include

#include

#include …ace/SOCK_Stream.h“// socket of type SOCK_STREAM

#include …ace/INET_Addr.h“// address in Internet domain

#include …ace/SOCK_Connector.h“// active connection establishmnt

void usage(char* prog)

{

cerr << …Usage: … << prog << … [user]@[host]“ << endl;

exit(1);

}

main(int argc, char **argv)

{

// (1) simple argument parsing

if (argc!=2)

usage(argv[0]);

char* user=argv[1];

char* host=strrchr(user,‘@‘);

if (!host)

usage(argv[0]);

*host++=‘\0‘;

// (2) ACE_SOCK_Stream encapsulates a socket of type SOCK_STREAM ACE_SOCK_Stream ?ngerd;

// (3) connection establishment using an ACE_SOCK_Connector

ACE_SOCK_Connector connector(?ngerd,

ACE_INET_Addr(…?nger“,host));

// (4) Fehlerbehandlung: Rueckgabewerte und Makros

if (?ngerd.get_handle()==-1)

LM_ERROR_RETURN((LOG_ERROR,

…connection to host \“%s\“ failed%p\n“,host,“…),1);

// (5) request

char buf[1024];

sprintf(buf,“%s%s“,user,“\r\n“);

if (?ngerd.send_n(buf,strlen(buf))==-1)

LM_ERROR_RETURN((LOG_ERROR,“%p\n“,“send_n“),1);

// (6) answer

while(?ngerd.recv(buf,1024)>0)

cout << buf;

cout << ?ush;

// (7) explicitly close the connection

if (?ngerd.close()==-1)

LM_ERROR_RETURN((LOG_ERROR,“%p\n“,“close“),1);

return 0;

}

Figures

Figure 1:

Net.h++ layered architecture Figure 2:Socket++ class hierarchy

Communication

Services

Layer IOStreams Module Communication Server Module Portal

Layer

Portal Communication Adapters Layer Socket Adapter Address Adapter TLI Adapter Pipe / FIFO Adapter Tunnel

Adapter Foundation Layer Tools.h++

Acceptor Connector

Higher Level Class

Categories and

Frameworks Adaptive Service Executve (ASX)

THR Manager Log

Msg

Reactor Service

Configura-

tor

Shared

Malloc C++

Wrappers

SYNCH Wrappers SPIPE

SAP

SOCK/

TLI SAP

FIFO

SAP

Mem

Map

System V

Wrappers

Thread Library Stream

Pipes

Sockets/

TLI

Named

Pipes

select/

poll

dlopen

Family

mmap

Family

System V

IPC

C APIs

Process Subsystem

Streams

Subsystem

Virtual Memory

Subsystem

OS

Services

Figure 3:Components of ACE

Boxes

Box 1: Abstract

- Net.h++, Socket++, and ACE are object-oriented encapsulations of interprocess communication channels like Sockets, System V TLI, or Unix Pipes.

- Net.h++ is a commercial product, Socket++ and ACE are freely available software.

- Common to the three tools is comfortable support of Sockets and Socket addresses

- The tools differ in their basic philosophy and in their power. ACE offers the widest range of functionality, but also has the highest learning curve.

Box 2: What is important?

Platforms supported: The number of operating systems the product is offered or tested for should be as large as possible. This is, however, not the only criterion for assessing the possible range of applications. The number of communication channels supported, e.g. Sockets, System V TLI or the different Pipe mechanisms, is of almost equal importance. Their support should be extensive, since the implementations offered by the different suppliers (e.g. for Winsocks) can differ. Furthermore the number of compilers tested plays a certain role, because not every compiler supports all C++ features. If the library is not available in source code, incompatible object codes may also give rise to problems. The ideal class library should allow the development of a code which is independent from the biggest possible number of operating systems, communication channels, implementations of different manufacturers and compilers. The minimum requirement results from the application planned for the near future and from your own system environment.

Layered Architecture: The library should permit a relatively free selection of the degree of abstraction and aggregation during programming. This aim is backed by an appropriate inheritance hierarchy: the more abstract classes implement common features, the leaves of the inheritance tree realize the differences between differing communication concepts. In order to guarantee the highest possible degree of ?exibility, access to the lower layers which are closer to the system must not be blocked. The syntax of this lower level should be largely based on the original C-API in order to make use of the programmer's empirical knowledge. At a high abstraction level complex program sequences should be formulated as simple as possible. In this context a comfortable handling is required which can be provided by an appropriate combination of single operations. It would be desirable to have access to communication channels using the

C++IOStream interface. Heterogeneity can be improved using the transparent support granted by Sun XDR. Useful utility classes, e.g. for a presentation of addresses and services, round off the

picture. Wherever possible the interface should offer useful default parameters - e.g. the local machine for describing a host or SOCK_STREAM for specifying a Socket type.

Extension Capacity: The library's class hierarchy should perform clear categorisations. This will make it easier for the programmer to integrate his own additions and at the same time increases the probability of reuse. If, for example, a communication mechanism is to be used, which has not been supported so far, the structure of the class hierarchy should give clear indications on how to integrate the addition in such a way that the new classes interact smoothly with the old ones. Individual extensions to the library are particularly easy when using C++ Templates.

Ef?ciency: With a view to interprocess communication the runtime behavior is of central importance. However, this behavior is dif?cult to measure, because the implementation of the library is only one of many variables. Other parameters include the speci?c application, the degree of network utilisation and the respective hardware or software platforms. For that reason, we have not focused on the run-time ef?ciency of the libraries in this article.

Error Treatment: Today Exception Handling provides the most ?exible mechanism for treating errors or exceptions under C++. Exception Handling is particularly suitable for use in libraries, because it allows to separate error detection from error treatment. Unfortunately not all compilers support this mechanism - this will be different in the near future, however. As the minimum standard the user should be informed on the current error status by way of returned values or global variables, and the library should offer an appropriate default behavior for unanticipated conditions.

Other (general) requirements may include the documentation, the support offered or the compatibility with other existing libraries. The investment protection, which the manufacturer is able to offer, may be another assessment criterion.

资源循环科学与工程本科专业人才培养方案

源循环科学与工程本科专业人才培养方案 (专业代码:081303T) 培养目标 通过学习化学理论基础、资源循环利用原理、基本实验技能、科学研究方法与工程应用技术,培养学生掌握扎实的化学和资源循环科学理论和实践基础,学习资源循环利用与材料成分、结构、性能、工艺之间内在的基础化学规律。重视以化学的视角制备材料、解决资源与环境的协调性,培养出能从事资源循环利用、新能源开发利用、能源环境保护以及农业、工业废物资源化开发、研究、设计与管理等工作的跨学科复合型高级人才。 培养要求 基本规格:本专业学生主要学习化学和资源环境科学的基础知识、基本理论和基本技能,受到基础研究和应用研究方面的科学思维和科学实验方法训练,具有良好的科学素养,具备运用所学理论知识和实验技能进行科学研究、技术开发和经营管理的能力。 学生应获取的知识与能力: 1. 具有扎实的自然科学基础,良好的人文与社会科学素质及表达能力; 2.系统学习化学、资源循环科学基本理论,具有扎实的专业基础知识与实验技能,培养科学的思维能力,接受基础与应用研究方法与技能的系统训练; 3.掌握现代资源循环利用的科学理论与方法及资源与环境相关的检测技术; 4.掌握化学化工文献检索、资料查询方法与技巧,具有较强的计算机及网络应用能力; 5. 了解以化学为基础的资源循环利用的前沿理论、应用前景及最新发展动态,以及资源循环相关产业发展状况; 6.掌握一门外国语,具有一定的听、说、读、写能力,能比较熟练地阅读本专业外文文献。 学制与学位 学制:本科基本学制为4年,学习年限为3-8年。 学位:按要求完成学业且符合学位授予条件者,授予工学学士学位。

主干学科与主要课程 主干学科:化学、资源循环科学与工程 主要课程:无机化学、有机化学、分析化学、物理化学、化工原理、绿色化学、资源循环科学与工程概论、环境科学基础、循环经济概论、农林废弃物资源化利用技术、固体废弃物资源化等。 主要实践环节 毕业论文及毕业设计、认识实习、专业实习、创新创业实践。 学分总体安排 1.课程学分 课程共136.1学分;必修课103.1学分,占课程总学分的75.7%;选修课33学分,占课程总学分的24.3%。 2.实践教学环节总学分 实践教学环节总学分为34.5学分,占毕业总学分的20.2%。 教学进程(附表1~5) 毕业标准与要求 1.达到德育培养目标。 2.修满本培养方案规定的学分,总学分不少于170学分。 3.达到国家教育部要求的大学生体育合格标准。

循环经济三大原则

循环经济三大原则 循环经济主要有三大原则,即“减量化、再利用、资源化”原则,每一原则对循环经济的成功实施都是必不可少的。 减量化原则针对的是输入端,旨在减少进入生产和消费过程中物质和能源流量。换句话说,对废弃物的产生,是通过预防的方式而不是末端治理的方式来加以避免。在生产中,制造厂可以通过减少每个产品的原料使用量、通过重新设计制造工艺来节约资源和减少排放。例如,通过制造轻型汽车来替代重型汽车,既可节约金属资源,又可节省能源,仍可满足消费者乘车的安全标准和出行要求。在消费中,人们以选择包装物较少的物品,购买耐用的可循环使用的物品而不是一次性物品,以减少垃圾的产生。 再利用原则属于过程性方法,目的是延长产品和服务的时间强度。也就是说,尽可能多次或多种方式地使用物品,避免物品过早地成为垃圾。在生产中,制造商可以使用标准尺寸进行设计,例如使用标准尺寸设计可以使计算机、电视和其他电子装置非常容易和便捷地升级换代,而不必更换整个产品。在生活中,人们可以将可维修的物品返回市场体系供别人使用或捐献自己不再需要的物品。 资源化原则是输出端方法,能把废弃物再次变成资源以减少最终处理量,也就是我们通常所说的废品的回收利用和废物的综合利用。资源化能够减少垃圾的 者遗弃的废弃物资源化后形成与原来相同的新产品,例如将废纸生产出再生纸, 废玻璃生产玻璃,废钢铁生产钢铁等;即废弃物变成与原来不同类型的新产品。原级资源化利用再生资源比例高,而次级资源化利用再生资源比例低。与资源化过程相适应,消费者应增强购买再生物品的意识,来促进整个循环经济的实现。 首先要减少经济源头的污染物的产生量,因此工业界在生产阶段和消费者在使用阶段就要尽量避免各种废物的排放;其次是对于源头不能消减又可利用的废弃物和经过消费者使用的包装废物、旧货等要加以回收利用,使它们回到经济循环中去;只有那些不能利用的废弃物,才允许作最终的无害化处置。以固体废弃物为例,

循环日志记录下的离线全备份及版本恢复 实验环境:操作系统

循环日志记录下的离线全备份及版本恢复 实验环境:操作系统(windows xp professional )、数据库管理系统(DB2 企业服务器版版本 9.7)、数据库(sample) 步骤: 1、以administrator帐户登陆系统,在开始--→运行-→db2cmd 2、在CLP中连接sample 数据库:db2 connect to sample 3、确认sample数据库工作在循环日志记录方式下。 (1):db2 get db cfg | find “LOGARCHMETH1” 第一个日志归档方法(LOGARCHMETH1) = OFF (2):db2 get db cfg | find “LOGARCHMETH2” 第二个日志归档方法(LOGARCHMETH2) = OFF (3):db2 get db cfg | find “LOGRETAIN” 启用的恢复的日志保留(LOGRETAIN) = OFF (4):db2 get db cfg | find “USEREXIT” 启用的日志记录的用户出口(USEREXIT) = OFF 上面4个数据库配置参数的值全为OFF,表明数据库运行在循环日志记录模式下。 4:对sample数据库做离线全备份 Db2 backup database sample to c:\db2back 备份成功。此备份映像的时间戳记是:20110602111145 5:检查备份镜像的完整性以及其是否可以用于恢复 db2ckbkp -h c:\db2back\SAMPLE.0.DB2.NODE0000.CATN0000.20110602111145.001 ===================== MEDIA HEADER REACHED: ===================== Server Database Name -- SAMPLE Server Database Alias -- SAMPLE Client Database Alias -- SAMPLE Timestamp -- 20110602111145 Database Partition Number -- 0 Instance -- DB2 Sequence Number -- 1 Release ID -- D00 Database Seed -- 4E4EECCA DB Comment's Codepage (Volume) -- 0 DB Comment (Volume) -- DB Comment's Codepage (System) -- 0 DB Comment (System) -- Authentication Value -- 255 Backup Mode -- 0 Includes Logs -- 0 Compression -- 0 Backup Type -- 0

学生档案管理系统

题学生档案管理系统 前言 面对中国教育事业的蓬勃发展,学生档案管理系统是一个学校可以有效运行占据着 重要地位,它能够为用户提供充足的信息和快捷的查询手段。他可以使学校的决策者和管理者更高效率的管理学校事物。随着科学技术的的不断发展提高,传统的人

工的方式管理文件系统的弊端越来越突出,如效率低,保密性差,尤其是不能及时快捷的对数据进行查找,更新和维护。 使用计算机对学生档案信息进行管理,有着手工管理所无法比拟的优点:检索迅速、查找方便、可靠性高、存储量大、保密性好、寿命长、成本低等。这些优点不仅提高学生档案管理的效率,也是企业的科学化、正规化管理, 与世界接轨的重要条件。 因此,开发一套对学生信息进行管理的软件是各个高校急需解决的问题,我们将以开发一套学生档案管理系统为例, 谈谈其开发过程和所涉及到的问题及解决方法。

目录 前言 (2) 第一章.为什么要开发一个学生档案管理系统 (5) 1.1计算机已经成为我们学习和工作的助手 (5) 1.2面对世界范围的信息化,以及计算机的普及,我们很有必要跟上世界的步伐, 普及中国的信息网络化 (5) 1.3开发一个学生档案管理系统的必要性 (5) 第二章.怎样开发一个学生档案管理系统 (6) 2.1开发工具包:Visual Studio 2008 (6) 2.2Visual Studio 2008 是目前最热门的面向对象的开发工具,里面有各种供 用户使用的控件 (7) 2.3数据库:SQL Server2005 (7) 第三章.使用Windows7操作系统下的Visual Studio 2008 (8) 3.1使用Visual Studio 2008 (8) 3.2C# 语言使用简介 (8) 3.3功能分析 (8) 3.4角色定义 (9) 第四章.使用SQL Server2005 数据库 (9) 4.1首先构建数据库 (9) 4.2SQL Server2005 为我们提供便利的数据库编写方 (9) 4.3构建数据表 (9) 4.4数据表的增删改查和更新 (9) 第五章.系统的具体实现 (10) 5.1功能层次设计 (10) 5.2模块设计 (11) 5.2.1 .用户登录模块设计 (11) 5.2.2.................................................................. 系统主界面模块设计11

仓库管理系统c语言

精心整理 作品名称 开发者: 一、系统背景: 本软件能减轻对货物数目管理及价格盈亏等信息处理的工作量以便能快捷 数 ·在员工模式下可输入卖出货物的名称和数目程序自动在后台进行一系列的操作·新建数据并同时对其处理 ·修改数据 ·插入数据 ·删除数据

·查找数据 ·查看数据 ·数据存档 ·修改密码 三、系统结构图 { float win; float percent; struct shop *next; }; int n=0;

void main(void) { void auto1(struct shop **h_p); int menu1(struct shop **h_p); void print1(void); int data_exi(struct shop **h_p); void load(struct shop **h_p); void save(struct shop *head); struct shop *addbuild(struct shop **h_p); void sort0(struct shop **h_p);

int search1(struct shop **h_p,char a[30]); void sort1(struct shop **h_p); void sort2(struct shop **h_p); void sort3(struct shop **h_p); void print3(void); { } printf("谢谢使用^_^"); getch(); } int menu1(struct shop **h_p) {

c语言课设仓库管理系统

《高级语言程序设计》课程设计 小型仓库管理系统 题目: 班级: 学生学号: 学生姓名: 同组成员: 指导老师: 提交时间: 成绩: 华南农业大学信息学院

一、需求分析 ⑴系统概述: 本系统用于小型仓库的信息管理,可实现仓库物品信息的增加、删除、查询、显示功能,以及仓库的入库信息记录、出库信息记录、查询指定物品的信息及出入库记录、显示紧缺物品信息的功能,此外还有密码功能,可保护仓库信息的安全性。 ⑵系统运行环境: 本系统方便简捷,对系统的软、硬件要求不高,在任何系统环境下都能很好的运行。 ⑶功能需求描述: 本系统分为两大块,分别为系统管理和出入库管理。其中,系统管理包括增加物品信息、删除物品信息、查询物品信息、显示物品信息、设置仓库密码五个功能;出入库管理包括物品出库、物品入库、库存物品查询、显示紧缺物品四个功能。以下对各功能作一些介绍: a.增加物品信息:新增一条物品信息,包括编号、名称、警界库存量。 b.删除物品信息:可通过物品编号或名称删除该物品的信息,物品数为 0时方可删除。 c.查询物品信息:可通过物品编号或名称来查询指定物品的信息,并显 示出来 d.显示物品信息:该功能可以显示所有库存物品的信息,包括物品编号、 名称、警戒库存量、当前库存数。 e.设置仓库密码:为保护仓库数据不被随意窜改,本系统要求仓库管理 员设置密码,成功后可随意更改。 f.物品入库:通过物品编号或名称可实现该指定物品的入库操作,记录 下该物品的入库信息,包括物品编号、入库物品数量、物品单价、提 供商、采购员五个信息。 g.物品出库:通过物品编号或名称可实现该指定物品的出库操作,记录 下该物品的出库信息,包括物品编号、出库物品数量、提货原因、提 货员四个信息。如果申请的提货数量超过当前库存数时,则操作失败。 h.库存物品查询:通过物品编号或名称可查找该指定物品的信息,包括 编号、名称、警戒库存量、当前库存数五个信息,以及该物品所有的 入库与出库信息。

循环用书管理方案

乌苏市第四小学循环教材 使用管理方案 根据教育局关于义务教育阶段学生循环教材使用工作意见精神,为进一步培养学生节约资源、爱护课本、不在课本上乱写乱画、保持课本整洁、养成良好的学习习惯,增强学生责任意识和环境保护意识,确保循环教材的使用工作落到实处,结合我校实际情况,现制定如下循环教材使用管理办法和实施细则。 一、循环教材适用范围 凡纳入义务教育免费提供教科书范围学校的义务教育阶段学生,下列科目教科书实行循环使用:小学《科学》、《音乐》、《美术》、《信息技术》。 二、循环教材使用的性质 循环教材是学校的教育装备,属于公共资源,由国家免费提供,学校集中管理,学生免费使用,实行年度纵向循环,不属于学生个人所有。 三、循环教材使用的组织机构 管理员:廖大坤 成员:美术、科学、音乐、信息技术教师 负责研究解决实施过程中出现的问题,以保证循环教材的使用效果。具体负责组织实施部循环教材的使用管理。 四、循环教材的管理办法及实施细则 1、循环教材的总体要求

循环教材属学校财产,学校对循环教材建专柜专档,对循环教材的登记、发放、回收、统计、更新等项工作要作出具体规定,解决好实施过程中可能出现的各种问题,保证学生有书用,用好书。 2、循环教材的发放、回收 学校保证教科书按照学生人数足额配备,在新学期开始时发放到各班任课老师处,确保学生课前有书,人手一册,学期结束时完整回收。 3、教材的存放及登记造册、档案管理 学校将循环教材安排专人负责,相关人员协助管理。 4、使用过程中的登记、造册、保管、回收 由相关科任教师发放给学生,教育学生妥善保管,避免损坏、遗失。期末回收时由任课教师检查是否有涂画和损坏现象,并作好登记,遗失、涂画和损坏严重的由学生照价赔偿。 5、循环教材的更新 书本损坏严重不能循环使用的书要更新,并作好循环教材的更新工作。 6、硬件建设 提供适宜的保管、储存场所和空间,以保证循环使用工作的顺利、正常开展。 6、教科书使用过程中做到“三不”、“四无”在实施循环教材的使用工作中,教师要更新教育观念,转变教学方式,不在教科书上留作业。开展爱书保洁活动,教育学生节约资源,爱护课本,教育学生

循环经济的3r原则是指

循环经济的3r原则是指 循环经济的理论基础 1.循环经济的定义 循环经济是对物质闭环流动型经济的简称,是一种以资源的高效利用和循环利用为核心,以“减量化、再利用、资源化”为原则,以低消耗、低排放、高资源利用率为基本特征,符合可持续发展理念的经济增长模式;是把清洁生产和废弃物综合利用融为一体的经济;通过废弃物或废旧物质的再循环和再利用发展经济,其目标是使生产和消费过程中投入的自然资源最少,向环境中排放的废弃物最少,对环境的危害和破坏最小。通俗地讲,循环经济就是利用社会生产和消费过程中产生的各种废旧物资进行循环、利用、再循环、再利用,以至循环不断的经济过程。 循环经济本质上是一种生态经济,要求运用生态学规律来指导人类的社会生产活动,按照自然生态系统物质循环和能量流动规律重构经济系统,使经济系统和谐地纳入到自然生态系统的物质循环过程,建立起一种新形态的经济。它把经济活动组成为“资源-产品再生资源”的反馈式流程,使所有资源都能不断地在流程中得到合理开发和持久利用,使经济活动对自然环境的不良影响降低到尽可能小的程度,是建设资源节约型和环境友好型社会的最直接表达方式。 2.循环经济的“3R”原则 循环经济不是单纯的经济问题,也不是单纯的技术问题和环保问题,而是一个系统工程,其特征是低开采、低排放、高利用,是将所有的物质和能源在这个不断进行的经济环中得到合理和持久的利用,力争把经济活动对自然环境的影响降低到尽可能小的程度循环经济

的核心是减量化( Reducing)、再利用( Reusing)和资源化( Resources) (1)减量化 减量化就是在经济系统的输入端对所要投入的各种资源进行控制,旨在从源头节约资源的使用和减少污染物的排放,从而减少生产和消费过程中的物质能量流。该思想要求人们在生产进行之前就对如何节省资源、提高资源利用率以及如何预防废弃物的产生进行思考与控制。 减量化属于对生产过程输入端的控制方法。 (2)再利用 再利用就是将还具有利用价值的资源或废弃物重新返回到生产过程或消费中,尽可能多次地使用或通过尽可能多的方式去处理加工使其成为资源,从而使资源得到最大化的利用,并减少生产过程中资源的消耗以及废弃物的产生,以最大化地延长资源的时间强度。

1 心搏骤停后自主循环的恢复.

1心搏骤停后自主循环的恢复 自主循环恢复(ROSC)后,经常会发生心血管功能和血流动力学的紊乱,常见有:低血容量性休克、心源性休克和与全身炎性反应综合征(SIRS)相关的血管扩张性休克。多种致病因素均可导致复苏后综合征的发生:如无再灌注、再灌注损伤、缺血后代谢产物引起的脑中毒及凝血功能障碍。 自主循环恢复后,是否会发生复苏后综合征的4期病理变化,还取决于组织器官的缺血程度和缺血时间。(1)几乎50%的复苏后综合征患者,其死亡多发生在发病后24小时内。这主要是因为在自主循环恢复后,心血管功能处于不稳定状态,12~24小时后才可逐渐趋向稳定。同时,由于多部位缺氧造成的微循环功能障碍,使有害的酶和自由基快速释放至脑脊液和血液中,并随代谢紊乱的进一步发展,大脑和微血管异常状态将持续存在。(2)1~3日后,心功能和全身情况将有所改善,但由于肠道的渗透性增加,易于发生脓毒血症。如同时多个器官均有严重的功能损害,特别是有肝脏、胰脏和肾脏的损害,则会导致多器官功能障碍综合征(MODS)的发生。(3)最终,严重的感染经常会发生在心搏骤停数日后,此时患者常常迅速发展为多器官衰竭(MOF)。(4)发生死亡。 心肺复苏后主要的治疗目标是完全地恢复局部器官和组织的血液再灌注,但单纯恢复血压和改善组织的气体交换,并不能提高复苏后的生存率。值得注意的是,这些观测指标并不能表明周围器官组织成功的复苏和有效的血供,特别是内脏和肾脏血液循环的恢复,而这些器官对缺氧缺血、心搏骤停后导致MODS起到重要的作用。 多数情况下,足够的通气和血液灌注恢复后,心搏骤停后出现的酸血症可以自行纠正。一直没引起注意的内脏血流低灌注的情况,只有经特殊的监测方法和恰当治疗方可确定。目前,除应用尚有争议的有创性肺动脉导管监测血流动力学外,还可应用定量测定胃黏膜二氧化碳分压(PCO2)梯度来指导内脏的复苏。胃黏膜PCO2梯度可在ICU病房中作为有创血流动力学监测重要的辅助手段。其目的是在复苏后早期最大程度地恢复内脏血流灌注,避免发展为MODS。 高级生命支持(ACLS):《指南2000》中总结了对复苏成功患者纠正其血流动力学异常状态的经验。从创伤后的研究和SIRS的治疗中得到许多有用的数据,《指南2000》中所有的建议就是根据这一依据提出的。有关心搏骤停患者脑神经复苏后的血流动力学支持方面,目前尚无临床随机试验所触及。 心肺复苏后治疗的近期目标:(1)提供心肺功能的支持,以满足组织灌注,特别是对大脑的灌注;(2)及时将院前心搏骤停患者转运至医院急诊科,再转运至设备完善的ICU病房;(3)及时明确诊断心脏停搏可能的原因;(4)完善治疗措施,如可给予抗心律失常药物治疗,以免心律失常再发。 心肺复苏后,患者的机体状况会发生很大变化。有的患者可能完全康复,血流动力学和大脑功能均恢复正常。相反,有的患者可能仍处于昏迷状态,心肺功能仍不能恢复正常。对所有患者都需要仔细、反复地评估其一般状况,包括心血管功能、呼吸功能和神经系统功能。临床医生还应该及时发现复苏时的各种合并症,如肋骨骨折、血气胸、心包填塞、腹内脏器损伤和气管插管异位等。 2心肺复苏后的最佳反应 心肺复苏后最好的情况是患者恢复清醒状态,有知觉和自主呼吸,需给患者维持多导联心电监护和提供足够的氧供。如在复苏时还未能开始治疗,可先予生理盐水静滴。如果患者有低血糖病史,可以静滴葡萄糖液。如果周围静脉或中央静脉内置入导管时不能保证无菌操作,或保护不完善时,需要重新更换导管。心脏停搏的原因是心室颤动(室颤)或室性心动过速,未给抗心律失常药物治疗时,除非有明确禁忌证(如室性逸搏心律),应考虑用利多卡因推注

c语言课程设计学生档案管理系统

程序设计基础课程设计 实验报告书 目录 1.设计题目....................................................... 2.正文........................................................... 2.1系统简介....................................................... 2.2选题背景....................................................... 2.3设计内容....................................................... 2.4设计思路....................................................... 2.5算法(条列式或流程图)......................................... 2.6程序清单与运行结果............................................. 2.7总结........................................................... 1.设计题目 学生信息管理系统设计 2.正文 2.1 系统简介 学生信息包括:学号,姓名,年龄,性别,出生年月,地址,电话,E-mail等。试设

计一学生信息管理系统,使之能提供以下功能: 1、系统以菜单方式工作 2、学生信息录入功能(学生信息用文件保存)--输入 3、学生信息浏览功能--输出 4、学生信息查询功能--按学号查询、按姓名查询、 5、学生信息的删除与修改(可选项) 要求:使用文件方式存储数据。 2.2选题背景 经典计算机问题,设计学生信息管理系统,可以进行多项系统信息管理功能。 2.3设计内容 设计学生信息管理的各个功能。系统以菜单方式工作。学生信息录入功能(学生信息用文件保存)--输入。学生信息浏览功能--输出。学生信息查询功能--按学号查询、按姓名查询。学生信息的删除与修改(可选项) 2.4设计思路 将程序的各个功能分开独立的执行,问题有大而小,细化。

C语言实训题目

2011秋季C语言实训题目 1.学生成绩管理系统 功能要求: (1)可以从文件导入或录入多名学生的多门课程的学习成绩; (2)完成按姓名查找学生记录,并显示; (3)排序功能:按学生平均成绩进行排序; (4)插入功能:按平均成绩高低插入一条学生记录; (5)要求使用结构体,录入结果存放到文件; 显示要求: 程序输出菜单,用户按照提示操作,最终得到操作结果。 2.个人通讯录 功能需求: (1)可以对多名人物的信息进行输入; (2)显示所有的记录信息,若无记录,则给出提示信息; (3)可以按姓名查询该记录的有关信息; (4)可以按姓名对任意一种记录信息进行删除; (5)可以任意修改记录信息 (6)通过文件储存所输入的记录; (7)可以通过一个文件读入已有的通信录记录; 显示要求: 程序输出菜单,用户按照提示操作,最终得到操作结果。 3. 火车订票系统 功能要求: (1)列车原始信息从文件导入或从控制台录入,包括车次、票数等; (2)可以按车次进行列车信息查询; (3)客户对某一天订票,订票成功后,当日的票数需要被更改; (4)客户退票; (5)要求使用结构体; 显示要求: 程序输出菜单,用户按照提示操作,最终得到操作结果。 4、万年历系统 功能要求: (1)从2000年开始,用户输入年份与月份,将显示出该年该月份的日历,对应的星期。

(2)注意闰年情况 显示格式要求如下: (1)第一行显示月份(中英文都可以) (2)下一行显示星期,从周日到周六,中英文都可以 (3)下一行开始显示日期从1号开始,并按其是星期几实际情况与上面的星期数垂直对齐(4)程序输出菜单,用户按照提示操作,最终得到计算结果。 5、积分的实现 功能要求: (1)使用复合梯形公式求解函数f=1+x2、f=log(1+x)以及f=1/(1+x2)三个函数的定积分。(2)积分上下限及步长由C语言函数参数传递。 (3)用户输入函数编号,上下限和步长,程序输入结果。 显示要求: 程序输出菜单,用户按照提示操作,最终得到计算结果。 6、矩阵的运算 功能要求: 使用三个C语言函数分别实现两个矩阵的加、减和相乘功能。结果存放在第三个矩阵中。并编写程序验证三个函数功能。 每个函数的参数可选择(1):二位数组名,行数,列数 (2)指针变量名,行数,列数 返回值:用户自定义的运算状态,正常或其他异常情况。 显示要求: 程序输出菜单,用户按照提示操作,最终得到计算结果。 7. 链表的实现 编制一个程序,实现下面的要求 1. 程序启动后显示主菜单,包括下面的选项: 1. 链表查看 2. 插入节点 3. 删除节点 4. 链表存盘 5. 从文件调入 6. 退出 按下相应的数字键后进入各自的子功能 2. 每个子功能执行完毕后,返回并显示主菜单 3. 功能说明: 1. 链表查看:从头结点向后依次显示各结点中保存的数据 2. 插入节点:创建一个结点,输入新结点的数据,以及要插入的位置,将新结点插 入到链表中。 3. 删除节点:输入要删除的数据,从头结点依次查找,找到拥有该数据的结点后,

仓库管理系统C课程设计报告

《高级语言程序设计》 课程设计报告 设计题目图书管理系统 专业计算机科学与技术 班级 姓名 学号 2007 年6 月5日 目录 1.设计目的 (3) 2.设计思想 (3) 3.类及对象设计 (4) 4.程序源代码 (5) 5.调试记录 (16) 6.总结 (18) 仓库管理系统 1.设计目的 通过实习进一步掌握所学的基本知识,学会解决实际问题的方法 2设计题目 1、问题描述(功能要求):某公司现有以下设备:普通电视机、DVD、带DVD 的电视机,带DVD的电视机的售价为普通电视机和DVD单价之和的80%,要求对所有的库存设备都能按照品名进行显示、查找、增加和删除、保存的功能。

2、问题的解决方案: 根据系统功能要求,可以将问题解决分为以下步骤: (1)分析系统中的各个实体之间的关系及其属性和行为; (2)根据问题描述,设计系统的类层次; (3)完成类层次中各个类的描述(包括属性和方法); (4)完成类中各个成员函数的定义; (5)完成系统的应用模块; (6)功能调试; (7)完成系统总结报告以及系统使用说明书。 2.设计思想 (1)设计classadmin管理库,实现对仓库信息的描叙;class shelf柜台类库实现建立电器资料;class ele电器类,实现对电器的描述,电器的编号,货架号,名称,数量,价格等;class mana函数类,实现对电器的入库,查找,出库等。 (3)设计菜单来实现功能设计 1、输入商品 2、商品查找 3、查询入库 4、商品出库 5、退出系统 3.设计类及对象 (1)本程序定义了四个类,定义如下: classadmin { public: admin(); private:

循环经济的定义和原则

循环经济的定义和原则 所谓循环经济(Circular Economy),是对物质闭环流动型(Closing Materials Cycle)经济的简称。它倡导在物质不断循环利用的基础上发展经济,建立资源—产品—再生资源的新经济模式,以彻底改变资源—产品—污染排放的直线、单向流动的传统经济模式。发展循环经济、建立循环型社会在西方发达国家已经成为一股潮流和趋势,德国、日本等国家已经将其看作增强竞争力的重要手段并制订了相应的法律加以推进,如德国于1996 年颁布了《循环经济与废物管理法》,日本在2000 年制订了《推进形成循环型社会基本法》。我国一直都非常重视循环经济及其相关概念如清洁生产和生态工业等的推行工作,有意识地引入循环经济的理念并在上海和辽宁等省市层次探索循环经济实施与推进的机制。无疑,循环经济作为区域层次上协调资源利用、环境保护和经济发展的有效途径,它在全国范围内的迅速推广和实施将使我国有能力面对可持续发展的进一步挑战,并且有利于保持我国长期的竞争地位。 循环经济的主要原则是:减少资源利用量及废物排放量(Reduce),大力实施 物料的循环利用系统(Recycle),以及努力回收利用废弃物(Reuse),这就是著名的三R 法则。显然,循环经济的实施将使资源和能源得到最合理和持久的利用, 并使经济活动对环境的不良影响降低到尽可能小的程度。循环经济完全符合可持续发展战略的思想,对环境和资源的保护有益,对子孙后代有益。 江泽民出席全国环境基金第二届成员大会开幕式 并发表重要讲话 全国环境基金第二届成员大会于10 月16 日至18 日在北京召开。中国国家 主席江泽民出席开幕式,并发表了题为《采取积极行动共创美好家园》的重要讲话。他说,推进可持续发展,要求我们努力实现经济增长、环境保护和社会全面进步的协调。发展经济、消除贫困,是实现可持续发展的基本前提。合理利用资源、保护环境,是实现可持续发展的必然要求。只有走以最有效利用资源和保护环境为基础的循环经济之路,可持续发展才能得到实现。实现社会全面进步、提高人民的生活水平和质量,是可持续发展的最终目标。

仓库管理系统(c语言)

仓库管理系统(c语言)

作品名称 开发者: 一、系统背景: 本软件能减轻对货物数目管理及价格盈亏等信息处理的工作量以便能快捷及时准确的调整货物的仓储量达到最合理化。可以使店主不失效率的节省大量精力用于其他方面符合当今社会的商业形式而且本软件体积小操作简单是管理仓库的不二选择 二、系统简介: 设计亮点: ◆三级菜单使操作更简便明了 ◆密码操作能有效保证客户信息的安全性 ◆独特的dos命令调用使信息存储的实体属性为隐藏且无扩展名大大增大了安全系数 ◆数据结构为链表摆脱了数据数量的限制 ◆提供三种查看模式并会标出排名 ◆退出店主模式时会提示是否保存若选择yes着进行保存操作 基本功能: ·在员工模式下可输入卖出货物的名称和数目程序自动在后台进行一系列的操作·新建数据并同时对其处理 ·修改数据 ·插入数据 ·删除数据

·查找数据 ·查看数据 ·数据存档 ·修改密码 三、系统结构图 #define LEN sizeof(struct shop) #include #include #include #include struct shop { char name[30]; float price_in; float price_out; int num_in; int num_now; int num_sold; float win; float percent; struct shop *next; };

void main(void) { void auto1(struct shop **h_p); int menu1(struct shop **h_p); void print1(void); void assistant(struct shop *head); int password(void); int menu2(struct shop **h_p); void print2(void); void creat(struct shop **h_p); void rewrite(struct shop **h_p); void insert(struct shop **h_p); void deleat(struct shop **h_p); void search(struct shop **h_p); void printall(struct shop **h_p); void save(struct shop *head); void password_set(void); int password_exi(struct shop **h_p); int data_exi(struct shop **h_p); void load(struct shop **h_p); void save(struct shop *head); struct shop *addbuild(struct shop **h_p); void sort0(struct shop **h_p); int search1(struct shop **h_p,char a[30]); void sort1(struct shop **h_p); void sort2(struct shop **h_p); void sort3(struct shop **h_p); void print3(void); void password_create(void); struct shop *addbuild(struct shop **h_p); int a; struct shop *head,**h_p; head=NULL; h_p=&head; auto1(h_p); do { a=menu1(h_p); } while(a!=3); system("cls"); printf("谢谢使用^_^");

仓库管理系统详细设计

详细设计说明 题目:仓库管理系统 学院:计算机科学与工程学院 专业:信息管理与信息系统 学生姓名:黄桂 学号:1200340119 指导教师:张纪元 2015年9月25日

1.引言 (1) 1.1编写目的 (1) 1.2项目背景 (1) 1.4定义 (2) 1.5参考资料 (2) 2.总体设计 (2) 2.1总体概述 (2) 2.2软件结构 (3) 3.程序描述 (4) 3.1程序功能 (4) 3.1.1类图结构 (5) 3.1.2开发视图 (5) 3.2程序性能 (7) 3.3程序的输入项 (7) 3.4程序的输出项 (8) 3.5算法 (9) 3.6程序逻辑 (10) 3.7接口 (11) 3.8存储分配 (12) 3.9限制条件 (13) 3.10测试要点 (13) 4系统静态模型 (13) 4.1系统用例模型 (13) 4.2仓库管理系统用例图。 (15) 4.3功能分配 (16)

1.引言 1.1编写目的 本需求分析报告的目的是规范化本软件的编写,旨在于提高软件开发过程中的能见度,便于对软件开发过程中的控制与管理,同时提出了仓储管理系统的软件开发过程,便于程序员与客户之间的交流、协作,并作为工作成果的原始依据,同时也表明了本软件的共性,以期待能够获得更大范围的应用。 本文档的预期读者是:设计人员、开发人员、项目管理人员、测试人员、用户。 1.2项目背景 仓储管理系统(WMS)是仓储管理信息化的具体形式,它在我国的应用还处于起步阶段。目前在我国市场上呈现出二元结构:以跨国公司或国内少数先进企业为代表的高端市场,其应用WMS的比例较高,系统也比较集中在国外基本成熟的主流品牌;以国内企业为代表的中低端市场,主要应用国内开发的WMS产品。 物资的储存和运输是整个物流过程中的两个关键环节,被人们称之为“物流的支柱”。在商品交换过程中,虽然物资的购、销活动决定了物资的交换关系,但若没有物资的储存和运输,物资的这种交换关系则不能最终实现。 1.3范围 主要以《仓库管理系统开发需求分析》需求分析说明书提出基本范围,能够实施什么样有用的功能来有效的管理,并指导开发人员去开发这样的功能系统。

循环教材使用管理制度

安县花荄镇中 教材循环使用管理制度 为了促进教科书循环使用,培养学生树立关爱他人,爱护图书,爱护公物的精神,养成勤俭节约、保护资源良好习惯;加强对国家资源、能源的节约和环境保护意识,即是利国利民的好事,又对构建节约型社会具有深远意义。因此,学校根据上级领导部门的要求并结合本校的实际情况特制订教材循环使用制度: 一、成立教材循环使用领导小组: 组长:黄臣 副组长:于建军 成员:赵士铨刘小明艺体组全体教师年级组长各班班主任 二、循环使用教材科目: 《科学》、《美术》、《音乐》、《体育与健康》、《信息技术》 三、加大教育宣传,提高认识: 全校师生要确立循环使用教科书意识,学校将以教师会、家长会、学生会、出黑板报、举办主题班会等广方式,向教师、学生和家长宣传教科书循环使用的必要性和重要性,引导教师、学生、家长、社会各界人士确立教科书循环使用意识,争取他们理解和支持教科书循环使用工作。 四、具体措施 1、循环教科书登记制度

循环教科书登记由学校图书室负责,具体江莉老师负责,并纳入图书管理,本学期结束后,各班班主任要及时将各班学生手中要循环使用的教科书回收,回收后要做好清点工作,将损坏或严重污损的教科进行清理,将保存完好的教科书缴交江莉老师处进行登记造册。逐本编号(教材类),以便授课教师集中领取和学生借阅。 2、循环教科书使用制度 用于循环使用的循环教科书在领取和借阅时必须完备手续: ①各班班主任在开学时向图书室按本班总人数的30%领取循环教科书,领 取时,由班主任在借书清单上签字,期末由班主任和学科教师组织学生 按时集中归还,出现丢失或损坏严重不能再循环使用的书本,由班主任 和授课教师组织学生按价赔偿。 ②.各班班主任在发放新书和30%的旧课本时一定就妥善做好学生的思想 工作,要让学生明确,这些课本就是免费教材,每期期末要按时归还, 班主任在发放时一定要注明那些同学领取的是旧书那些同学领取的是新 书,在期末还书时对旧书质量要求可适当降低。 3、循环教科书管理制度 ①.在使用期间循环使用的教科书由各授课教师负责管理,要教育学生使用循环教科书时要另备课堂笔记,用书时做到“三不”(不乱写、不乱画、不署名)、“四无”(无破损、无缺页、无污染、无褶皱)。如学生在用书期间人为损坏或污损则通知家长,说明情况,要求家长按原价赔偿。学生使用的循环教科书,由学生自己保管,如丢失或损坏、污损不能再用,按图书室相关制度执行赔偿。

学生电子档案管理系统(学生、辅导员使用方...

学生电子档案管理系统(学生、辅导员) 学生电子档案管理系统(学生)提供给学生管理个人的档案信息。如学生告知书查阅,学生基本档案资料管理,老师管理,学习成绩管理,就业指导管理,信息通知管理,师生沟通的有问必答管理,学习和生活月志管理,资格证书管理,课程管理,缴费注册及学籍管理,以及学生毕业必备条件信息管理等。 学生电子档案管理系统包括顶部的导航栏与底部左侧的菜单项目列表和右侧的内容显示区。 图 1 系统主页 一、密码修改 (1)用户点击导航栏的“我的资料”文字按钮,接着点击基本档案资料管理页中的“修改密码”按钮,可以打开用户的“密码修改”对话框。 图2 密码修改 (2)接着输入新密码及重新输入新密码确认后,点击“保存”按钮完成密码修改。 二、基本档案资料管理 (1)用户点击导航栏的“我的资料”文字按钮,直接进入个人基本档案资料登记页。

图 3 基本资料管理 (2)填写完整档案资料后,点击“保存基本信息”按钮保存档案资料,点击“返回”按钮取消保存并返回系统主页。 要求:1、学生必须填写父母姓名、联系电话及家庭地址,辅导员、班主任要审核确认。 2、证件照片要采用身份证照片,不能用生活照代替。 三、退出系统 用户点击导航栏的“安全退出”文字按钮,可以直接注销登录信息后退出系统,并返回到登录页。 四、告知书管理 (1)用户点击系统主页左侧菜单列表的“告知书”选项,进入学生管理告知书管理页。 图 4 告知书管理 (2)接着点击相应告知书记录“查阅”列的“查阅”文字按钮,阅览告知书明细。 五、老师管理 用户直接点击系统主页左侧菜单列表“我的老师”选项,可查看任课老师的联系方式。

仓库管理系统c语言

作品名称 开发者: 一、系统背景: 本软件能减轻对货物数目管理及价格盈亏等信息处理的工作量以便能快捷及时准确的调整货物的仓储量达到最合理化。可以使店主不失效率的节省大量精力用于其他方面符合当今社会的商业形式而且本软件体积小操作简单是管理仓库的不二选择 二、系统简介: 设计亮点: ◆三级菜单使操作更简便明了 ◆密码操作能有效保证客户信息的安全性 ◆独特的dos命令调用使信息存储的实体属性为隐藏且无扩展名大大增大了安全系数 ◆数据结构为链表摆脱了数据数量的限制 ◆提供三种查看模式并会标出排名 ◆退出店主模式时会提示是否保存若选择yes着进行保存操作 基本功能: ·在员工模式下可输入卖出货物的名称和数目程序自动在后台进行一系列的操作 ·新建数据并同时对其处理 ·修改数据 ·插入数据 ·删除数据

·查找数据 ·查看数据 ·数据存档 ·修改密码 三、系统结构图 #define LEN sizeof(struct shop) #include<> #include<> #include<> #include<> struct shop { char name[30]; float price_in;

float price_out; int num_in; int num_now; int num_sold; float win; float percent; struct shop *next; }; int n=0; void main(void) { void auto1(struct shop **h_p); int menu1(struct shop **h_p); void print1(void); void assistant(struct shop *head); int password(void); int menu2(struct shop **h_p); void print2(void); void creat(struct shop **h_p); void rewrite(struct shop **h_p); void insert(struct shop **h_p); void deleat(struct shop **h_p);

相关文档
最新文档