Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-27-2007
Ewgenijkkg Ewgenijkkg is offline
Registered User
 
Name: Ewgenij Sokolovski
Organization: RWTH
Project: Rove
 
Join Date: Mar 2007
Posts: 36
Getting the progress information from IcePatch2

Hello What is the API of IcePatch2 for mapping of the patch progression? I mean how can I derive the information about the state of the patch progression while IcePatch2-Client is running? You present your own graphical client for IcePatch2 in the manual, but I couldn't find any information about how it derives the progression state from the underlying IcePatch2-application.

Best regards
Ewgenij
Reply With Quote
  #2 (permalink)  
Old 07-28-2007
fmoya fmoya is offline
Registered User
 
Name: Francisco Moya
Organization: UCLM
Project: Debian packages
 
Join Date: Oct 2004
Posts: 48
IcePatch2::PatcherFeedback

Ice for C++ provides a include/IcePatch2/ClientUtil.h implementing an asynchronous IcePatch2 client. There are hooks for providing feedback at several points.

See demo/IcePatch2/MFC/PatchClientDlg.{h,cpp} for an example of this.

Regards,
Paco
__________________
Francisco Moya Fernandez
Computer Architecture and Tecnology Group
University of Castilla-La Mancha

Debian Maintainer of ZeroC Ice packages.
Reply With Quote
  #3 (permalink)  
Old 07-28-2007
Ewgenijkkg Ewgenijkkg is offline
Registered User
 
Name: Ewgenij Sokolovski
Organization: RWTH
Project: Rove
 
Join Date: Mar 2007
Posts: 36
Hello, thanks for your remarks. I looked at the corresponding sources before posting my question. But the problem is that the hooks are not marked there and I do not know where exactly the information is derived. So I thought it would be a great help if somebody could name and describe the hooks shortly so I can localize and use them. It would save me a lot of time to search and understand the way of working of these classes.

Greetings
Ewgenij
Reply With Quote
  #4 (permalink)  
Old 07-28-2007
fmoya fmoya is offline
Registered User
 
Name: Francisco Moya
Organization: UCLM
Project: Debian packages
 
Join Date: Oct 2004
Posts: 48
Did you look at the code?

From the include/IcePatch2/ClientUtil.h:

Code:
class ICE_PATCH2_API PatcherFeedback : public IceUtil::Shared
{
public:
    virtual bool noFileSummary(const std::string&) = 0;

    virtual bool checksumStart() = 0;
    virtual bool checksumProgress(const std::string&) = 0;
    virtual bool checksumEnd() = 0;

    virtual bool fileListStart() = 0;
    virtual bool fileListProgress(Ice::Int) = 0;
    virtual bool fileListEnd() = 0;

    virtual bool patchStart(const std::string&, Ice::Long, Ice::Long, Ice::Long) = 0;
    virtual bool patchProgress(Ice::Long, Ice::Long, Ice::Long, Ice::Long) = 0;
    virtual bool patchEnd() = 0;
};
I think it is pretty straightforward:
  • noFileSummary: The checksum file is missing at the client side.
  • checksumStart: Starting the checksum computation phase.
  • checksumProgress: Invoked whenever a new checksum is computed.
  • checksumEnd: End of checksum computation phase.
  • fileListStart: Starting the file list preparation phase.
  • fileListProgress: Progress in this phase (as a percentage).
  • fileListEnd: End of file list preparation phase.
  • patchStart: Started patching a file.
  • patchProgress: Progress in current file patching.
  • patchEnd: Finished patching current file.

If you want the details read src/IcePatch2/ClientUtil.cpp and src/IcePatch2/Util.cpp.

If you just want to use it read src/IcePatch2/Client.cpp or demo/IcePatch2/MFC/PatchClientDlg.*

Regards,
Paco
__________________
Francisco Moya Fernandez
Computer Architecture and Tecnology Group
University of Castilla-La Mancha

Debian Maintainer of ZeroC Ice packages.
Reply With Quote
  #5 (permalink)  
Old 08-02-2007
Ewgenijkkg Ewgenijkkg is offline
Registered User
 
Name: Ewgenij Sokolovski
Organization: RWTH
Project: Rove
 
Join Date: Mar 2007
Posts: 36
Hey, and what are the arguments of

virtual bool fileListProgress(Ice::Int),
virtual bool patchStart(const std::string&, Ice::Long, Ice::Long, Ice::Long) and

virtual bool patchProgress(Ice::Long, Ice::Long, Ice::Long, Ice::Long)?

Ewgenij
Reply With Quote
  #6 (permalink)  
Old 08-02-2007
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,088
As mentioned you should look at demo/IcePatch2/MFC for details on this stuff.

Code:
virtual bool
fileListProgress(Ice::Int percent)

virtual bool
patchStart(const string& path, Ice::Long size, Ice::Long totalProgress, Ice::Long totalSize)

virtual bool
patchProgress(Ice::Long progress, Ice::Long size, Ice::Long totalProgress, Ice::Long totalSize)
Reply With Quote
  #7 (permalink)  
Old 08-02-2007
fmoya fmoya is offline
Registered User
 
Name: Francisco Moya
Organization: UCLM
Project: Debian packages
 
Join Date: Oct 2004
Posts: 48
Why don't you read the code?

I must over stress that Ice is very well written. If you are coding an application with Ice you can read C++. Besides, Ice code is very readable. Besides, I told you what to look at. Besides, it takes less than a minute to answer your question by reading the code and a few hours to get a response in the forums. Is this some kind of allergy to foreign code ;-) ?

From demo/IcePatch2/MFC/PatchClientDlg.cpp:
Code:
class DialogPatcherFeedback ...
{ ...
    virtual bool fileListProgress(Ice::Int percent) ...
    virtual bool patchStart(const string& path, Ice::Long size, Ice::Long totalProgress, Ice::Long totalSize) ...
    virtual bool patchProgress(Ice::Long progress, Ice::Long size, Ice::Long totalProgress, Ice::Long totalSize) ...
};
If you want the details, again, src/IcePatch2/ClientUtil.cpp
  • percent is the percentage of FileInfo structures got.
  • path is the file that is going to be patched now.
  • size is the size of the file to be patched.
  • totalProgress is the overall number of bytes already updated.
  • totalSize is the overall patch size, including all files to be patched.

Regards,
F. Moya
__________________
Francisco Moya Fernandez
Computer Architecture and Tecnology Group
University of Castilla-La Mancha

Debian Maintainer of ZeroC Ice packages.
Reply With Quote
  #8 (permalink)  
Old 08-02-2007
eric.hill eric.hill is offline
Registered User
 
Name: Eric Hill
Organization: Pioneer Balloon Co.
Project: Internal Research
 
Join Date: Jul 2006
Location: Wichita, KS
Posts: 25
Quote:
Is this some kind of allergy to foreign code?
Indeed it is. Remember, real programmers use...
Code:
C:\PROJECT>COPY CON PROGRAM.EXE
Also, does that mean people who are hyper-allergenic are allergic to multi-threading?
__________________
Eric Hill - ijack.net
Pioneer Balloon Co.
Reply With Quote
  #9 (permalink)  
Old 08-09-2007
Ewgenijkkg Ewgenijkkg is offline
Registered User
 
Name: Ewgenij Sokolovski
Organization: RWTH
Project: Rove
 
Join Date: Mar 2007
Posts: 36
Thank you! OK, I see there is no other way than reading foreign code...

One more question. After I read the code I didn't find a possibility to retrieve the lists of deleted and updated files. There are FileInfo structures in the Patcher class

FileInfoSeq _localFiles;
FileInfoSeq _updateFiles;
FileInfoSeq _updateFlags;
FileInfoSeq _removeFiles;

which contain the required information, but they are private and there are no functions available to access their contents. So if I want to get the lists of deleted and updated files I have to make changes to the sources of IcePatch2. Or is there another way?

Regards
Ewgenij
Reply With Quote
  #10 (permalink)  
Old 08-09-2007
fmoya fmoya is offline
Registered User
 
Name: Francisco Moya
Organization: UCLM
Project: Debian packages
 
Join Date: Oct 2004
Posts: 48
ClientUtil is just an example

Please, note that ClientUtil has nothing to do with the IcePatch service itself. If you do not like the abstraction provided by Patcher class do not hesitate to build your own.
Many of my students (third year undergrad) didn't feel comfortable with C++ and they built their own abstractions using just the IcePatch Slice interfaces. Most of them came up with different ways to build and save the lists themselves.
__________________
Francisco Moya Fernandez
Computer Architecture and Tecnology Group
University of Castilla-La Mancha

Debian Maintainer of ZeroC Ice packages.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What does IcePatch2-Client if the connection to IcePatch2-Server breaks? Ewgenijkkg Help Center 1 07-11-2007 08:44 PM
Newbie problem, receiving Objects without information m4v3rick Help Center 6 11-13-2006 11:51 PM
ICE connection lifecycle information/implementing recovery mcrystal Help Center 1 09-28-2006 06:04 PM
Get information from the other side aroan Help Center 1 12-27-2004 01:32 PM
Background Information mick Comments 1 02-27-2003 07:27 AM


All times are GMT -4. The time now is 12:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.