473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to achieve seamless wrapping


Hi,
In our application, we acess a around many external data sources ranging
from sql to file shares. The code base is huge and been there for a while.

What I would like to achieve is:

Say, currently I call function foo once.
I would like to wrap this in a function say foowrap...which tries to invoke
the function x times before throwing up. Something like

void foo(){}

void foowrap()
{
for(int i=0;i<PolicyLimit;++i)
try
{
foo();
break;
}
catch(Exception e){}
}

The wrapper should be able to take any no of parameters and return the type
of the wrapped.

I have a working example, below

delegate void MyDelegate<T>(T a);

static class Robust<T>

{

public static void Invoke(MyDelegate<TmyDelegate, T param)

{

for (int i = 0; i < 10; ++i)

try

{

myDelegate(param);

break;

}

catch (Exception e){}

}

}

class Program

{

static void H(int k)

{

Console.WriteLine("Hello World");

}

static void Main(string[] args)

{

Robust<int>.Invoke(H, 7);

}

}

Please tell me, what would be the best way to go? AOP?

::Rajiv
Apr 13 '07 #1
0 867

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Roy Smith | last post by:
I've got a C library with about 50 calls in it that I want to wrap in Python. I know I could use some tool like SWIG, but that will give me a too-literal translation; I want to make some...
11
by: yawnmoth | last post by:
word wrapping normally treats some spaces as line feeds, if there hasn't been a line feed for quite a while. so while a string with eighty consecutive a's might not word wrap, a space placed...
16
by: Peter Maas | last post by:
The XHTML file below creates a 2x2 matrix of square images. There is always some space at the bottom borders of the cells (when rendered with Gecko and KHTML, not with IE) and I've found no way so...
1
by: Bennett Haselton | last post by:
One of the most convenient features of Visual Studio .Net and ASP.Net is being able to add rows to a SQL Server database in an intellisense-safe way, with code like: ...
0
by: Joe Rigley | last post by:
Hi, I'm a little new to ASP Dotnet, but have been coding in classic ASP for over 5 years... I'd appreciate some suggestions/guidance in writing an Intranet login page that authenticates...
0
by: Just D. | last post by:
Does anybody know how to create a seamless frameset? If I try to use a right click on the form in .NET IDE it breaks the whole form, even if I can get the checkbox "Seamless" checked it actually...
1
by: Crirus | last post by:
Hi! I have a seamless image drawn onto a PictureBox. I wrote a mouseMove handle that allow me to drag the image around in that pictureBox. I whould like to do this When the border of the image...
8
by: Nathan | last post by:
I am trying to prevent a horizontal list from wrapping. Each list item is floated with "float: left". Currently I use an ugly hack. I set the width of the list to a large number which is...
0
by: Morgan Cheng | last post by:
I have one webservice written in MC++, which uses another native DLL deployed in %webservice_install_dir%\bin folder. The API invocation between MC++ and native C++ looks seamless. The compilation...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.