mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:42:43 +00:00 
			
		
		
		
	LibIPC: Start fleshing out a separate IPC library
This will be a place to put object serialization/deserialization logic, message parsing, endpoint management, etc.
This commit is contained in:
		
							parent
							
								
									aa8a3d4a89
								
							
						
					
					
						commit
						a40e763b2a
					
				
					 7 changed files with 81 additions and 0 deletions
				
			
		|  | @ -19,6 +19,7 @@ build_targets="$build_targets ../DevTools/IPCCompiler" | |||
| build_targets="$build_targets ../Libraries/LibC" | ||||
| build_targets="$build_targets ../Libraries/LibM" | ||||
| build_targets="$build_targets ../Libraries/LibCore" | ||||
| build_targets="$build_targets ../Libraries/LibIPC" | ||||
| build_targets="$build_targets ../Libraries/LibDraw" | ||||
| build_targets="$build_targets ../Libraries/LibAudio" | ||||
| build_targets="$build_targets ../Servers/SystemServer" | ||||
|  |  | |||
							
								
								
									
										9
									
								
								Libraries/LibIPC/IEndpoint.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Libraries/LibIPC/IEndpoint.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| #include <LibIPC/IEndpoint.h> | ||||
| 
 | ||||
| IEndpoint::IEndpoint() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| IEndpoint::~IEndpoint() | ||||
| { | ||||
| } | ||||
							
								
								
									
										16
									
								
								Libraries/LibIPC/IEndpoint.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								Libraries/LibIPC/IEndpoint.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <AK/AKString.h> | ||||
| 
 | ||||
| class IEndpoint { | ||||
| public: | ||||
|     virtual ~IEndpoint(); | ||||
| 
 | ||||
|     const String& name() const { return m_name; } | ||||
| 
 | ||||
| protected: | ||||
|     IEndpoint(); | ||||
| 
 | ||||
| private: | ||||
|     String m_name; | ||||
| }; | ||||
							
								
								
									
										9
									
								
								Libraries/LibIPC/IMessage.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Libraries/LibIPC/IMessage.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| #include <LibIPC/IMessage.h> | ||||
| 
 | ||||
| IMessage::IMessage() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| IMessage::~IMessage() | ||||
| { | ||||
| } | ||||
							
								
								
									
										18
									
								
								Libraries/LibIPC/IMessage.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Libraries/LibIPC/IMessage.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| #pragma once | ||||
| 
 | ||||
| #include <AK/AKString.h> | ||||
| #include <AK/ByteBuffer.h> | ||||
| 
 | ||||
| class IMessage { | ||||
| public: | ||||
|     virtual ~IMessage(); | ||||
| 
 | ||||
|     const String& name() const { return m_name; } | ||||
|     virtual ByteBuffer encode() = 0; | ||||
| 
 | ||||
| protected: | ||||
|     IMessage(); | ||||
| 
 | ||||
| private: | ||||
|     String m_name; | ||||
| }; | ||||
							
								
								
									
										21
									
								
								Libraries/LibIPC/Makefile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Libraries/LibIPC/Makefile
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| include ../../Makefile.common | ||||
| 
 | ||||
| OBJS = \
 | ||||
|     IEndpoint.o \
 | ||||
|     IMessage.o | ||||
| 
 | ||||
| LIBRARY = libipc.a | ||||
| DEFINES += -DUSERLAND | ||||
| 
 | ||||
| all: $(LIBRARY) | ||||
| 
 | ||||
| $(LIBRARY): $(OBJS) | ||||
| 	@echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS) | ||||
| 
 | ||||
| .cpp.o: | ||||
| 	@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $< | ||||
| 
 | ||||
| -include $(OBJS:%.o=%.d) | ||||
| 
 | ||||
| clean: | ||||
| 	@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d | ||||
							
								
								
									
										7
									
								
								Libraries/LibIPC/install.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								Libraries/LibIPC/install.sh
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| #!/bin/bash | ||||
| 
 | ||||
| set -e | ||||
| SERENITY_ROOT=../../ | ||||
| 
 | ||||
| mkdir -p $SERENITY_ROOT/Root/usr/include/LibIPC/ | ||||
| cp *.h $SERENITY_ROOT/Root/usr/include/LibIPC/ | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling